docs: update outdated formula references for Node

This commit is contained in:
Jonathan Chang 2020-09-08 23:23:32 +10:00
parent 15a56655c8
commit 83f62d1fad

View File

@ -32,11 +32,11 @@ Node modules which are compatible with the latest Node version should declare a
depends_on "node"
```
If your formula requires being executed with an older Node version you should use one of the versioned node formulae (e.g. `node@6`).
If your formula requires being executed with an older Node version you should use one of the versioned node formulae (e.g. `node@12`).
### Special requirements for native addons
If your Node module is a native addon or has a native addon somewhere in its dependency tree you have to declare an additional dependency. Since the compilation of the native addon results in an invocation of `node-gyp` we need an additional build time dependency on `"python"` (because GYP depends on Python 2.7).
If your Node module is a native addon or has a native addon somewhere in its dependency tree you have to declare an additional dependency. Since the compilation of the native addon results in an invocation of `node-gyp` we need an additional build time dependency on `"python"` (because GYP depends on Python).
```ruby
depends_on "python" => :build
@ -75,8 +75,6 @@ This will install your Node module in npm's global module style with a custom pr
bin.install_symlink Dir["#{libexec}/bin/*"]
```
**Note:** Because of a required workaround for `npm@5` calling `npm pack` we currently don't support installing modules (from non-npm registry tarballs), which require a prepublish step (e.g. for transpiling sources). See [Homebrew/brew#2820](https://github.com/Homebrew/brew/pull/2820) for more information.
### Installing module dependencies locally with `local_npm_install_args`
In your formula's `install` method, do any installation steps which need to be done before the `npm install` step and then `cd` to the top level of the included Node module. Then, use `system` with `Language::Node.local_npm_install_args` to invoke `npm install` like: