If you haven't imported the necessary PGP keys, the installer will print an error about "bootstrapping trust" and direct you to the README. However, the words "bootstrap" and "trust" never appear in the README.
This adjusts the warning to include some words that you can actually search the README for.
'command' is a shell builtin on all current shells
'which' is not builtin to bash, and if the node 'which' package is installed, that package may interfere
See https://github.com/asdf-vm/asdf-nodejs/issues/137 for an example of that interference
Per issue #46 the `ASDF_INSTALL_VERSION` variable is not available in global NPM installs. Instead the `npm_config_node_version` is provided by NPM during this situation.
This change offers a fallback in these cases. Since a version will be available this will significantly speed up the postinstall during global NPM installs.
Fixes#46
`.asdf/bin/private/asdf-exec` sets `$ASDF_INSTALL_PATH` to the result of
`find_install_path` in `.asdf/lib/utils.sh` - which, if version is
`"system"` (which it is for the system nodejs, of course), returns an
empty string. This then, is passed to
`.asdf/plugins/nodejs/bin/exec-env`, and, if `$NPM_CONFIG_PREFIX` is
`""`, it is set to `$ASDF_INSTALL_PATH/.npm` - resulting in `"/.npm"`.
In my shell w/o `asdf` enabled which can run `npm`, `$NPM_CONFIG_PREFIX`
is blank; therefore a possible patch would be to only set
`$NPM_CONFIG_PREFIX` if it is blank _and_ `$ASDF_INSTALL_PATH` is _not_.
On some platforms, including Fedora and derivatives, and Arch and
derivatives, the binary `shasum` does not exist. Instead, sha256sum
should be used.
This patch checks for the existence of sha256sum, as well as shasum,
and uses whichever is present. If none are present, a helpful error
message is printed out.
Tested on Fedora 28
- Scenarios tested:
-------------------------------
| Sha256sum | shasum | Works? |
| Yes | No | Yes |
| No | Yes | Yes |
| Yes | Yes | Yes |
| No | No | Yes |
-------------------------------
A bug existed where, if no versions of `node` and `npm` are installed
already, running `asdf install node <version>` while having any packages
listed inside `.default-npm-packages` would fail to install those
default packages because the newly installed node version's `bin`
directory is not in the `PATH` yet.
Fixes#67
This works in tandom with a change in asdf core that will look for the
exec-path command and use it appropriately when found to conditionally
route the npm & npx commands to the correct executable path.