asdf-vm / asdf-nodejs Goto Github PK
View Code? Open in Web Editor NEWNode.js plugin for asdf version manager
Home Page: https://github.com/asdf-vm/asdf
License: MIT License
Node.js plugin for asdf version manager
Home Page: https://github.com/asdf-vm/asdf
License: MIT License
Thoughts on reading the engines object from package.json to select the correct nodejs version?
I am trying to install nodejs 10.9.0 but every time I try I get an error by Curl.
asdf install nodejs 10.9.0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3856 0 3856 0 0 1395 0 --:--:-- 0:00:02 --:--:-- 1394
gpg: Signature made gio 16 ago 2018 03:44:43 CEST
gpg: using RSA key DD8F2338BAE7501E3DD5AC78C273792F7D83545D
gpg: Good signature from "Rod Vagg <[email protected]>" [unknown]
gpg: aka "Rod Vagg <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: DD8F 2338 BAE7 501E 3DD5 AC78 C273 792F 7D83 545D
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
45 17.6M 45 8175k 0 0 26817 0 0:11:30 0:05:12 0:06:18 140k
curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)
I updated curl with the last version but the issue is still present:
curl --version
curl 7.61.0 (x86_64-pc-linux-gnu) libcurl/7.61.0 OpenSSL/1.1.0g zlib/1.2.11 nghttp2/1.32.0
Release-Date: 2018-07-11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy
It seems that doing any npm install -g
is an order of magnitude slower with asdf-nodejs vs. a standard npm install.
My guess is that it is coming from the post install hook the seems to run on every dependency and every nested dependency for global installs. The post install hook seems to invoke bin/get-bin-names.js
for each package, which just parses package.json to find bin files to shim. I'm guessing a big chunk of that time is spent starting up a node process for each package.
I'd suggest we either:
get-bin-names.js
to a bash script that greps through the package.json to find the bin files (given the narrow acceptable values for the bin
property in a package.json, grepping seems like it might be possible, orbin/postinstall.sh
to node and consolidating it with bin/get-bin-names.js
, so we can avoid the hit for starting up a node process for each packageHappy to PR the latter approach (the former might stretch my bash-fu skills a bit) if there's any interest.
This is explained and solved, at least in my experience, by @petermm 's PR #41 .
I'm adding this as in issue as I ran into the same issue yesterday, but just checked in issues rather than here. This presents as:
shasum: /dev/fd/63: no properly formatted SHA256 checksum lines found
Authenticity of package archive can not be assured. Exiting.
Installing another global package seems to call the postinstall script, which does remove the old and add the new. I'm not sure if NPM can be made to hook that script on uninstall as well?
I've been using node 6.10.0 for a while (I had to import maintainers gpg signatures.)
I tried installing a previous version (6.2) but I keep getting the signature error :
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6227 0 6227 0 0 7545 0 --:--:-- --:--:-- --:--:-- 7547
gpg: no valid OpenPGP data found.
gpg: the signature could not be verified.
Please remember that the signature file (.sig or .asc)
should be the first file given on the command line.
Authenticity of checksum file can not be assured! Please be sure to check the README of asdf-nodejs in case you did not yet bootstrap trust. If you already did that then that is the point to become SUSPICIOUS! There must be a reason why this is failing. If you are installing an older NodeJS version you might need to import OpenPGP keys of previous release managers. Exiting.
I have a dedicated keyring, and I tried running both import-release-team-keyring
and import-previous-release-team-keyring
scripts.
Is there anything more to do ?
Reading quickly the install script, it seems that asdf-nodejs
only installs from binaries when installing a given version. This causes asdf install nodejs <version>
to fail on FreeBSD.
If the host OS or architecture has no precompiled binaries available, asdf-nodejs
should fetch the given version archive and build it from sources.
I am installing the NodeJS asdf plugin. After adding the plugin I proceed to import the release team OpenPGP keys to my keyring using the command specified in the README:
# Imports Node.js release team's OpenPGP keys to main keyring
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
Instead of importing the keys, I get the following error:
gpg: keyserver receive failed: No keyserver available
Hi,
I just had problems installing nodejs when checking validity of files:
.asdf/plugins/nodejs/bin/install: line 210: shasum: command not found
On my system I had to change this:
210: if ! shasum -a 256 --check <(grep "\s$archive_file_name$" "${authentic_checksum_file}"); then
to this:
210: if ! sha256sum --check <(grep "\s$archive_file_name$" "${authentic_checksum_file}"); then
On some other systems shasum
is called sha1sum
too. Other just have neither, just plain openssl
. I guess shasum
is not as cross-platform as we all would like. There are many issues around about this (portainer/portainer#507, dehydrated-io/dehydrated#42, http://stackoverflow.com/questions/7500691/rvm-sha256sum-nor-shasum-found, etc... )
I think you may abstract the shasum
command into a variable that is set up differently for each system, that way make it cross-platform-ish. O simply use openssl sha -sha256
. That should work everywhere, I guess.
Thanks
Using npm link
with packages that export a bin
doesn't make that bin useable.
Steps to reproduce:
git clone https://github.com/substack/node-mkdirp.git
cd node-mkdirp
echo "nodejs 4.2.4" > .tool-versions
npm link
mkdirp --help
# bash: mkdirp: command not found
Hey, I'm trying to figure out how to implement #11 and I can't seem to find any docs on how the postinstall hook works. Can you point me to some documentation on them?
I tried adding an npm link hook and it didn't work.
There is something wrong with the key, and I'm unable to install nodejs
~/.asdf/installs/nodejs$ asdf install nodejs 10.9.0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3856 0 3856 0 0 3464 0 --:--:-- 0:00:01 --:--:-- 3467
gpg: Signature made Thu 16 Aug 2018 08:44:43 WIB using RSA key ID 7D83545D
gpg: Good signature from "Rod Vagg <[email protected]>"
gpg: aka "Rod Vagg <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: DD8F 2338 BAE7 501E 3DD5 AC78 C273 792F 7D83 545D
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6747 0 6747 0 0 6127 0 --:--:-- 0:00:01 --:--:-- 6128
shasum: /dev/fd/63: no properly formatted SHA256 checksum lines found
Authenticity of package archive can not be assured. Exiting.
Just spent a good while tearing my hair out here! Glad I figured it out though.
PS I love asdf and I'm glad yall made it <3
asdf install nodejs 8.4.0
list nodejs
brew install gpg
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
asdf install nodejs 8.4.0
asdf list nodejs
> 8.4.0
I know the way certain version managers work make them not suitable for production environments, but is there any reason to not utilize asdf-vm in a prod env?
root@Mohsen-PC:/tmp# npm install -g yarn
/root/.asdf/installs/nodejs/11.0.0/.npm/bin/yarn -> /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/yarn/bin/yarn.js
/root/.asdf/installs/nodejs/11.0.0/.npm/bin/yarnpkg -> /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/yarn/bin/yarn.js
npm WARN lifecycle The node binary used for scripts is /root/.asdf/shims/node but npm is using /root/.asdf/installs/nodejs/11.0.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> [email protected] postinstall /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/yarn
> /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/.hooks/postinstall
sh: 1: /root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/.hooks/postinstall: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] postinstall: `/root/.asdf/installs/nodejs/11.0.0/.npm/lib/node_modules/.hooks/postinstall`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-10-31T12_47_29_279Z-debug.log
Things I have tried so far:
asdf shim nodejs
asdf reshim nodejs
asdf global nodejs 11.0.0
asdf local nodejs 11.0.0
(in /tmp folder)
sudo npm install -g yarn
added /root/.asdf/shims/
to secure_path
Please help. I usually manage my packages with yarn and pnpm, I had no problem with nvm
but recently I switched to asdf
because the idea is great, however I am having problems installing yarn and pnpm globally. Thanks.
$ asdf install nodejs 7.5.0
mktemp: illegal option -- -
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
mktemp [-d] [-q] [-u] -t prefix
The SunOS operating_system and cpu_type is not detected in the functions:
os_based_configure_options(),
get_download_file_path(),
get_download_url()
A match on substring "SunOS" from "uname -a" could be used to detect the operating system and "isainfo-b" could be used to get "64" or "32" to match on.
Also, it appears the operating_system variable is never initialized in get_download_file_path().
Here is a diff of a version which worked for me against master 2/16/17, although some refactoring to remove duplicate code seems warranted if more architectures are to be added:
$ diff install.ORIG install
67a68,77
>
> elif [[ "$operating_system" =~ "SunOS" ]]; then
> # reset cpu_type based on isainfo
> local bits=$(isainfo -b)
> if [[ "$bits" =~ "64" ]]; then
> local cpu_type="x64"
> else
> local cpu_type="x86"
> fi
>
90a101
> local operating_system=$(uname -a)
101a113,123
>
> elif [[ "$operating_system" =~ "SunOS" ]]; then
> # reset cpu_type based on isainfo
> local bits=$(isainfo -b)
> if [[ "$bits" =~ "64" ]]; then
> cpu_type="x64"
> else
> cpu_type="x86"
> fi
> local pkg_name="node-v${version}-sunos-${cpu_type}"
>
126a149,159
>
> elif [[ "$operating_system" =~ "SunOS" ]]; then
> # reset cpu_type based on isainfo
> local bits=$(isainfo -b)
> if [[ "$bits" =~ "64" ]]; then
> cpu_type="x64"
> else
> cpu_type="x86"
> fi
> echo "http://nodejs.org/dist/v${version}/node-v${version}-sunos-${cpu_type}.tar.gz"
>
Is there a best practice on how to install yarn with asdf-managed nodejs? Since yarn strongly discourages npm (there's no newer version than 0.18 published even)
I installed node 8.6.0 which comes with npm 5.3.0. I wanted to update npm to 5.4.2 but neither npm i -g npm@latest
nor npm up -g npm
work. Instead, a new npm is installed inside ~/.asdf/installs/nodejs/8.6.0/.npm/lib/node_modules
because of the environment config setting prefix = "~/.asdf/installs/nodejs/8.6.0/.npm"
. How am I supposed to perform the update?
$ npm -v
5.3.0
$ npm i -g npm@latest
+ [email protected]
$ asdf reshim nodejs
$ npm -v
5.3.0
😔
If I try to run
asdf which nodejs
The printed location is (on my machine)
/Users/alafroscia/.asdf/installs/nodejs/8.9.4/bin/nodejs
However, that's not actually a pointer to the executable; the executable is at
/Users/alafroscia/.asdf/installs/nodejs/8.9.4/bin/node
This doesn't match other plugins, such as ruby
and python
, which return the path to the actual executable.
import-release-team-keyring
failed with gpg: keyserver receive failed: No route to host
~/.asdf/plugins/nodejs ((b8683508…)|✔) ./bin/import-release-team-keyring
gpg: keyserver receive failed: No route to host
I will open PR for this.
Steps to reproduce:
asdf plugin-install nodejs https://github.com/asdf-vm/asdf-nodejs
asdf install nodejs 7.10.0
asdf global nodejs 7.10.0
npm -g install yarn
yarn global add eslint
# eslint is not shimmed, so I cannot execute eslint without an absolute path
npm -g install eslint
# eslint is shimmed now in ~/.asdf/shims
# eslint works
Looking at the source, it seems that npm is the only package manager that's managed in this plugin for postinstall hooks for shimming.
Hi,
I'm unable to install node 10.5.0
.
Here is what is happening:
~ % asdf install nodejs 10.5.0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4187 0 4187 0 0 32315 0 --:--:-- --:--:-- --:--:-- 32457
gpg: Signature made Wed Jun 20 20:46:00 2018 CEST
gpg: using RSA key 770F7A9A5AE15600
gpg: requesting key 770F7A9A5AE15600 from hkps server hkps.pool.sks-keyservers.net
gpg: Can't check signature: No public key
Authenticity of checksum file can not be assured! Please be sure to check the README of asdf-nodejs in case you did not yet bootstrap trust. If you already did that then that is the point to become SUSPICIOUS! There must be a reason why this is failing. If you are installing an older NodeJS version you might need to import OpenPGP keys of previous release managers. Exiting.
~ % bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
gpg: keyserver receive failed: No data
gpg: keyserver receive failed: No keyserver available
gpg: keyserver receive failed: No data
gpg: keyserver receive failed: No keyserver available
gpg: keyserver receive failed: No data
gpg: keyserver receive failed: No keyserver available
gpg: keyserver receive failed: No data
gpg: keyserver receive failed: No keyserver available
gpg: keyserver receive failed: No data
gpg: keyserver receive failed: No keyserver available
gpg: keyserver receive failed: No data
gpg: keyserver receive failed: No keyserver available
gpg: keyserver receive failed: No data
gpg: keyserver receive failed: No keyserver available
gpg: keyserver receive failed: No data
gpg: keyserver receive failed: No keyserver available
I'm running macos 10.13.5
and asdf v0.5.0
.
Best,
Stefan
The npm package postinstall hook tries to call npm shim nodejs
, but that command errors out if the plugin is installed by another name (like "node"). Is there a good way to tell asdf that I've customized the name of the plugin? Or should I just edit my postinstall hook manually for now?
Hi again @HashNuke
If you try installing live-server with npm install -g live-server
you should get live-server.js
in shims, passing "npm/bin/live-server.js" to nodejs plugin.
The actual binary's name is live-server
in .npm/bin
These names can be picked out from the package's package.json under the "bin" key. For live-server it's:
"bin": {
"live-server": "./live-server.js"
},
so the script's name will be "live-server". I'm not sure if you can add this reading of package.json as an additional test to determine $executable_name ?
I'm doing this: $(basename ${bin_env_parts[1]} .js)
to truncate the .js extension when setting executable_name
- generally, they're not installed with extension... but obviously this is not a proper solution. Just suggesting a "maybe good enough temporary fix" for the time being.
Cheers
Running with latest version of asdf-nodejs and nodejs 8.10.0
Running npm install -g serverless
I get the following error:
Jasons-MBP-2% npm install -g serverless
/Users/jason/.asdf/installs/nodejs/8.10.0/.npm/bin/serverless -> /Users/jason/.asdf/installs/nodejs/8.10.0/.npm/lib/node_modules/serverless/bin/serverless
/Users/jason/.asdf/installs/nodejs/8.10.0/.npm/bin/sls -> /Users/jason/.asdf/installs/nodejs/8.10.0/.npm/lib/node_modules/serverless/bin/serverless
/Users/jason/.asdf/installs/nodejs/8.10.0/.npm/bin/slss -> /Users/jason/.asdf/installs/nodejs/8.10.0/.npm/lib/node_modules/serverless/bin/serverless
npm WARN lifecycle The node binary used for scripts is /Users/jason/.asdf/shims/node but npm is using /Users/jason/.asdf/installs/nodejs/8.10.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> [email protected] postinstall /Users/jason/.asdf/installs/nodejs/8.10.0/.npm/lib/node_modules/serverless/node_modules/spawn-sync
> node postinstall
No version set for nodejs
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! [email protected] postinstall: `node postinstall`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jason/.npm/_logs/2018-04-18T00_31_09_624Z-debug.log
From this log the important error seems to be npm WARN lifecycle The node binary used for scripts is /Users/jason/.asdf/shims/node but npm is using /Users/jason/.asdf/installs/nodejs/8.10.0/bin/node itself. Use the
--scripts-prepend-node-path option to include the path for the node binary npm was executed with.
and No version set for nodejs
It seems that the error might be because serverless's postInstall is running commands like:
execSync(`node "${tabtabCliPath}" install --name serverless --auto`);
Not sure how to rectify the issue
As tested on two Ubuntu boxes and a Mac:
$ npm --version
5.3.0
$ npm install -g create-elm-app
# ... runs but doesn't call the postinstall hooks to create the shim
$ asdf global nodejs 8.1.2
$ npm --version
5.2.0
$ npm install -g create-elm-app
# ... runs and creates the shim as expected.
I'm having this crazy problem where only this one module blows up when trying to do a node-gyp rebuild
. It seems to be asdf-related, because if I switch over to nvm, I don't have this problem and everything installs fine. I can't for the life of me figure out what is different about this setup that would cause this. ¯_(ツ)_/¯
❯ npm i [email protected]
npm WARN lifecycle The node binary used for scripts is /Users/adam/.asdf/shims/node but npm is using /Users/adam/.asdf/installs/nodejs/8.9.4/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> [email protected] install /private/tmp/dummy/node_modules/keyboard-layout
> node-gyp rebuild
nodejs 0.11.13 not installed
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adam/.npm/_logs/2018-06-14T00_13_51_842Z-debug.log
❯ npm doctor
Check Value Recommendation
npm ping OK
npm -v v5.6.0 Use npm v6.1.0
node -v v8.9.4 Use node v8.11.3
npm config get registry https://registry.npmjs.org/
which git /usr/local/bin/git
Perms check on cached files ok
Perms check on global node_modules ok
Perms check on local node_modules ok
Verify cache contents verified 2008 tarballs
0 info it worked if it ends with ok
1 verbose cli [ '/Users/adam/.asdf/installs/nodejs/8.9.4/bin/node',
1 verbose cli '/Users/adam/.asdf/installs/nodejs/8.9.4/bin/npm',
1 verbose cli 'i',
1 verbose cli '[email protected]' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 647e1bf826b375d2
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://registry.npmjs.org/keyboard-layout 12ms (from cache)
8 silly pacote version manifest for [email protected] fetched in 36ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule [email protected] checking installable status
14 http fetch GET 200 https://registry.npmjs.org/nan 4ms (from cache)
15 http fetch GET 200 https://registry.npmjs.org/event-kit 6ms (from cache)
16 silly pacote range manifest for nan@^2.0.0 fetched in 6ms
17 silly resolveWithNewModule [email protected] checking installable status
18 silly pacote range manifest for event-kit@^1.0.0 fetched in 8ms
19 silly resolveWithNewModule [email protected] checking installable status
20 http fetch GET 200 https://registry.npmjs.org/grim 2ms (from cache)
21 silly pacote range manifest for grim@^1.2.1 fetched in 3ms
22 silly resolveWithNewModule [email protected] checking installable status
23 http fetch GET 200 https://registry.npmjs.org/emissary 1ms (from cache)
24 silly pacote range manifest for emissary@^1.2.0 fetched in 2ms
25 silly resolveWithNewModule [email protected] checking installable status
26 http fetch GET 200 https://registry.npmjs.org/underscore-plus 12ms (from cache)
27 http fetch GET 200 https://registry.npmjs.org/mixto 10ms (from cache)
28 http fetch GET 200 https://registry.npmjs.org/property-accessors 10ms (from cache)
29 http fetch GET 200 https://registry.npmjs.org/es6-weak-map 11ms (from cache)
30 silly pacote range manifest for [email protected] fetched in 14ms
31 silly resolveWithNewModule [email protected] checking installable status
32 silly pacote range manifest for [email protected] fetched in 13ms
33 silly resolveWithNewModule [email protected] checking installable status
34 silly pacote range manifest for property-accessors@^1.1 fetched in 13ms
35 silly resolveWithNewModule [email protected] checking installable status
36 silly pacote range manifest for es6-weak-map@^0.1.2 fetched in 13ms
37 silly resolveWithNewModule [email protected] checking installable status
38 http fetch GET 200 https://registry.npmjs.org/d 3ms (from cache)
39 http fetch GET 200 https://registry.npmjs.org/es6-iterator 3ms (from cache)
40 http fetch GET 200 https://registry.npmjs.org/es6-symbol 3ms (from cache)
41 silly pacote range manifest for d@~0.1.1 fetched in 4ms
42 silly resolveWithNewModule [email protected] checking installable status
43 silly pacote range manifest for es6-iterator@~0.1.3 fetched in 4ms
44 silly resolveWithNewModule [email protected] checking installable status
45 silly pacote range manifest for es6-symbol@~2.0.1 fetched in 5ms
46 silly resolveWithNewModule [email protected] checking installable status
47 http fetch GET 200 https://registry.npmjs.org/underscore 2ms (from cache)
48 silly pacote range manifest for underscore@~1.8.3 fetched in 3ms
49 silly resolveWithNewModule [email protected] checking installable status
50 silly currentTree [email protected]
50 silly currentTree ├─┬ [email protected]
50 silly currentTree │ ├── [email protected]
50 silly currentTree │ ├── [email protected]
50 silly currentTree │ └── [email protected]
50 silly currentTree └── [email protected]
51 silly idealTree [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├─┬ [email protected]
51 silly idealTree │ ├── [email protected]
51 silly idealTree │ ├── [email protected]
51 silly idealTree │ └── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree ├── [email protected]
51 silly idealTree └── [email protected]
52 silly install generateActionsToTake
53 silly diffTrees action count 13
54 silly diffTrees add [email protected]
55 silly diffTrees add [email protected]
56 silly diffTrees add [email protected]
57 silly diffTrees add [email protected]
58 silly diffTrees add [email protected]
59 silly diffTrees add [email protected]
60 silly diffTrees add [email protected]
61 silly diffTrees add [email protected]
62 silly diffTrees add [email protected]
63 silly diffTrees add [email protected]
64 silly diffTrees add [email protected]
65 silly diffTrees add [email protected]
66 silly diffTrees add [email protected]
67 silly decomposeActions action count 104
68 silly decomposeActions fetch [email protected]
69 silly decomposeActions extract [email protected]
70 silly decomposeActions preinstall [email protected]
71 silly decomposeActions build [email protected]
72 silly decomposeActions install [email protected]
73 silly decomposeActions postinstall [email protected]
74 silly decomposeActions finalize [email protected]
75 silly decomposeActions refresh-package-json [email protected]
76 silly decomposeActions fetch [email protected]
77 silly decomposeActions extract [email protected]
78 silly decomposeActions preinstall [email protected]
79 silly decomposeActions build [email protected]
80 silly decomposeActions install [email protected]
81 silly decomposeActions postinstall [email protected]
82 silly decomposeActions finalize [email protected]
83 silly decomposeActions refresh-package-json [email protected]
84 silly decomposeActions fetch [email protected]
85 silly decomposeActions extract [email protected]
86 silly decomposeActions preinstall [email protected]
87 silly decomposeActions build [email protected]
88 silly decomposeActions install [email protected]
89 silly decomposeActions postinstall [email protected]
90 silly decomposeActions finalize [email protected]
91 silly decomposeActions refresh-package-json [email protected]
92 silly decomposeActions fetch [email protected]
93 silly decomposeActions extract [email protected]
94 silly decomposeActions preinstall [email protected]
95 silly decomposeActions build [email protected]
96 silly decomposeActions install [email protected]
97 silly decomposeActions postinstall [email protected]
98 silly decomposeActions finalize [email protected]
99 silly decomposeActions refresh-package-json [email protected]
100 silly decomposeActions fetch [email protected]
101 silly decomposeActions extract [email protected]
102 silly decomposeActions preinstall [email protected]
103 silly decomposeActions build [email protected]
104 silly decomposeActions install [email protected]
105 silly decomposeActions postinstall [email protected]
106 silly decomposeActions finalize [email protected]
107 silly decomposeActions refresh-package-json [email protected]
108 silly decomposeActions fetch [email protected]
109 silly decomposeActions extract [email protected]
110 silly decomposeActions preinstall [email protected]
111 silly decomposeActions build [email protected]
112 silly decomposeActions install [email protected]
113 silly decomposeActions postinstall [email protected]
114 silly decomposeActions finalize [email protected]
115 silly decomposeActions refresh-package-json [email protected]
116 silly decomposeActions fetch [email protected]
117 silly decomposeActions extract [email protected]
118 silly decomposeActions preinstall [email protected]
119 silly decomposeActions build [email protected]
120 silly decomposeActions install [email protected]
121 silly decomposeActions postinstall [email protected]
122 silly decomposeActions finalize [email protected]
123 silly decomposeActions refresh-package-json [email protected]
124 silly decomposeActions fetch [email protected]
125 silly decomposeActions extract [email protected]
126 silly decomposeActions preinstall [email protected]
127 silly decomposeActions build [email protected]
128 silly decomposeActions install [email protected]
129 silly decomposeActions postinstall [email protected]
130 silly decomposeActions finalize [email protected]
131 silly decomposeActions refresh-package-json [email protected]
132 silly decomposeActions fetch [email protected]
133 silly decomposeActions extract [email protected]
134 silly decomposeActions preinstall [email protected]
135 silly decomposeActions build [email protected]
136 silly decomposeActions install [email protected]
137 silly decomposeActions postinstall [email protected]
138 silly decomposeActions finalize [email protected]
139 silly decomposeActions refresh-package-json [email protected]
140 silly decomposeActions fetch [email protected]
141 silly decomposeActions extract [email protected]
142 silly decomposeActions preinstall [email protected]
143 silly decomposeActions build [email protected]
144 silly decomposeActions install [email protected]
145 silly decomposeActions postinstall [email protected]
146 silly decomposeActions finalize [email protected]
147 silly decomposeActions refresh-package-json [email protected]
148 silly decomposeActions fetch [email protected]
149 silly decomposeActions extract [email protected]
150 silly decomposeActions preinstall [email protected]
151 silly decomposeActions build [email protected]
152 silly decomposeActions install [email protected]
153 silly decomposeActions postinstall [email protected]
154 silly decomposeActions finalize [email protected]
155 silly decomposeActions refresh-package-json [email protected]
156 silly decomposeActions fetch [email protected]
157 silly decomposeActions extract [email protected]
158 silly decomposeActions preinstall [email protected]
159 silly decomposeActions build [email protected]
160 silly decomposeActions install [email protected]
161 silly decomposeActions postinstall [email protected]
162 silly decomposeActions finalize [email protected]
163 silly decomposeActions refresh-package-json [email protected]
164 silly decomposeActions fetch [email protected]
165 silly decomposeActions extract [email protected]
166 silly decomposeActions preinstall [email protected]
167 silly decomposeActions build [email protected]
168 silly decomposeActions install [email protected]
169 silly decomposeActions postinstall [email protected]
170 silly decomposeActions finalize [email protected]
171 silly decomposeActions refresh-package-json [email protected]
172 silly install executeActions
173 silly doSerial global-install 104
174 verbose correctMkdir /Users/adam/.npm/_locks correctMkdir not in flight; initializing
175 verbose lock using /Users/adam/.npm/_locks/staging-9b558a35c3408069.lock for /private/tmp/dummy/node_modules/.staging
176 silly doParallel extract 104
177 silly extract [email protected]
178 silly extract [email protected]
179 silly extract [email protected]
180 silly extract [email protected]
181 silly extract [email protected]
182 silly extract [email protected]
183 silly extract [email protected]
184 silly extract [email protected]
185 silly extract [email protected]
186 silly extract [email protected]
187 silly extract [email protected]
188 silly extract [email protected]
189 silly extract [email protected]
190 silly doReverseSerial unbuild 104
191 silly doSerial remove 104
192 silly doSerial move 104
193 silly doSerial finalize 104
194 silly finalize /private/tmp/dummy/node_modules/d
195 silly finalize /private/tmp/dummy/node_modules/es6-symbol
196 silly finalize /private/tmp/dummy/node_modules/es6-iterator
197 silly finalize /private/tmp/dummy/node_modules/es6-weak-map
198 silly finalize /private/tmp/dummy/node_modules/mixto
199 silly finalize /private/tmp/dummy/node_modules/property-accessors
200 silly finalize /private/tmp/dummy/node_modules/underscore
201 silly finalize /private/tmp/dummy/node_modules/underscore-plus
202 silly finalize /private/tmp/dummy/node_modules/emissary
203 silly finalize /private/tmp/dummy/node_modules/grim
204 silly finalize /private/tmp/dummy/node_modules/event-kit
205 silly finalize /private/tmp/dummy/node_modules/nan
206 silly finalize /private/tmp/dummy/node_modules/keyboard-layout
207 silly doParallel refresh-package-json 104
208 silly refresh-package-json /private/tmp/dummy/node_modules/d
209 silly refresh-package-json /private/tmp/dummy/node_modules/es6-symbol
210 silly refresh-package-json /private/tmp/dummy/node_modules/es6-iterator
211 silly refresh-package-json /private/tmp/dummy/node_modules/es6-weak-map
212 silly refresh-package-json /private/tmp/dummy/node_modules/mixto
213 silly refresh-package-json /private/tmp/dummy/node_modules/property-accessors
214 silly refresh-package-json /private/tmp/dummy/node_modules/underscore
215 silly refresh-package-json /private/tmp/dummy/node_modules/underscore-plus
216 silly refresh-package-json /private/tmp/dummy/node_modules/emissary
217 silly refresh-package-json /private/tmp/dummy/node_modules/grim
218 silly refresh-package-json /private/tmp/dummy/node_modules/event-kit
219 silly refresh-package-json /private/tmp/dummy/node_modules/nan
220 silly refresh-package-json /private/tmp/dummy/node_modules/keyboard-layout
221 silly doParallel preinstall 104
222 silly preinstall [email protected]
223 info lifecycle [email protected]~preinstall: [email protected]
224 silly preinstall [email protected]
225 info lifecycle [email protected]~preinstall: [email protected]
226 silly preinstall [email protected]
227 info lifecycle [email protected]~preinstall: [email protected]
228 silly preinstall [email protected]
229 info lifecycle [email protected]~preinstall: [email protected]
230 silly preinstall [email protected]
231 info lifecycle [email protected]~preinstall: [email protected]
232 silly preinstall [email protected]
233 info lifecycle [email protected]~preinstall: [email protected]
234 silly preinstall [email protected]
235 info lifecycle [email protected]~preinstall: [email protected]
236 silly preinstall [email protected]
237 info lifecycle [email protected]~preinstall: [email protected]
238 silly preinstall [email protected]
239 info lifecycle [email protected]~preinstall: [email protected]
240 silly preinstall [email protected]
241 info lifecycle [email protected]~preinstall: [email protected]
242 silly preinstall [email protected]
243 info lifecycle [email protected]~preinstall: [email protected]
244 silly preinstall [email protected]
245 info lifecycle [email protected]~preinstall: [email protected]
246 silly preinstall [email protected]
247 info lifecycle [email protected]~preinstall: [email protected]
248 silly doSerial build 104
249 silly build [email protected]
250 info linkStuff [email protected]
251 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
252 verbose linkBins [email protected]
253 verbose linkMans [email protected]
254 silly build [email protected]
255 info linkStuff [email protected]
256 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
257 verbose linkBins [email protected]
258 verbose linkMans [email protected]
259 silly build [email protected]
260 info linkStuff [email protected]
261 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
262 verbose linkBins [email protected]
263 verbose linkMans [email protected]
264 silly build [email protected]
265 info linkStuff [email protected]
266 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
267 verbose linkBins [email protected]
268 verbose linkMans [email protected]
269 silly build [email protected]
270 info linkStuff [email protected]
271 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
272 verbose linkBins [email protected]
273 verbose linkMans [email protected]
274 silly build [email protected]
275 info linkStuff [email protected]
276 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
277 verbose linkBins [email protected]
278 verbose linkMans [email protected]
279 silly build [email protected]
280 info linkStuff [email protected]
281 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
282 verbose linkBins [email protected]
283 verbose linkMans [email protected]
284 silly build [email protected]
285 info linkStuff [email protected]
286 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
287 verbose linkBins [email protected]
288 verbose linkMans [email protected]
289 silly build [email protected]
290 info linkStuff [email protected]
291 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
292 verbose linkBins [email protected]
293 verbose linkMans [email protected]
294 silly build [email protected]
295 info linkStuff [email protected]
296 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
297 verbose linkBins [email protected]
298 verbose linkMans [email protected]
299 silly build [email protected]
300 info linkStuff [email protected]
301 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
302 verbose linkBins [email protected]
303 verbose linkMans [email protected]
304 silly build [email protected]
305 info linkStuff [email protected]
306 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
307 verbose linkBins [email protected]
308 verbose linkMans [email protected]
309 silly build [email protected]
310 info linkStuff [email protected]
311 silly linkStuff [email protected] has /private/tmp/dummy/node_modules as its parent node_modules
312 verbose linkBins [email protected]
313 verbose linkMans [email protected]
314 silly doSerial global-link 104
315 silly doParallel update-linked 104
316 silly doSerial install 104
317 silly install [email protected]
318 info lifecycle [email protected]~install: [email protected]
319 silly install [email protected]
320 info lifecycle [email protected]~install: [email protected]
321 silly install [email protected]
322 info lifecycle [email protected]~install: [email protected]
323 silly install [email protected]
324 info lifecycle [email protected]~install: [email protected]
325 silly install [email protected]
326 info lifecycle [email protected]~install: [email protected]
327 silly install [email protected]
328 info lifecycle [email protected]~install: [email protected]
329 silly install [email protected]
330 info lifecycle [email protected]~install: [email protected]
331 silly install [email protected]
332 info lifecycle [email protected]~install: [email protected]
333 silly install [email protected]
334 info lifecycle [email protected]~install: [email protected]
335 silly install [email protected]
336 info lifecycle [email protected]~install: [email protected]
337 silly install [email protected]
338 info lifecycle [email protected]~install: [email protected]
339 silly install [email protected]
340 info lifecycle [email protected]~install: [email protected]
341 silly install [email protected]
342 info lifecycle [email protected]~install: [email protected]
343 warn lifecycle The node binary used for scripts is /Users/adam/.asdf/shims/node but npm is using /Users/adam/.asdf/installs/nodejs/8.9.4/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
344 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle true
345 verbose lifecycle [email protected]~install: PATH: /Users/adam/.asdf/installs/nodejs/8.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/private/tmp/dummy/node_modules/keyboard-layout/node_modules/.bin:/private/tmp/dummy/node_modules/.bin:/Users/adam/.asdf/shims:/Users/adam/.asdf/bin:.git/safe/../../scripts:/Users/adam/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/adam/.fzf/bin:/Users/adam/Code/go/bin:/usr/local/heroku/bin:/Users/adamyonk/.cargo/bin
346 verbose lifecycle [email protected]~install: CWD: /private/tmp/dummy/node_modules/keyboard-layout
347 silly lifecycle [email protected]~install: Args: [ '-c', 'node-gyp rebuild' ]
348 info lifecycle [email protected]~install: Failed to exec install script
349 verbose unlock done using /Users/adam/.npm/_locks/staging-9b558a35c3408069.lock for /private/tmp/dummy/node_modules/.staging
350 silly saveTree [email protected]
350 silly saveTree └─┬ [email protected]
350 silly saveTree ├─┬ [email protected]
350 silly saveTree │ └─┬ [email protected]
350 silly saveTree │ └─┬ [email protected]
350 silly saveTree │ ├─┬ [email protected]
350 silly saveTree │ │ ├─┬ [email protected]
350 silly saveTree │ │ │ └─┬ [email protected]
350 silly saveTree │ │ │ ├─┬ [email protected]
350 silly saveTree │ │ │ │ ├── [email protected]
350 silly saveTree │ │ │ │ └── [email protected]
350 silly saveTree │ │ │ ├── [email protected]
350 silly saveTree │ │ │ └── [email protected]
350 silly saveTree │ │ ├── [email protected]
350 silly saveTree │ │ ├─┬ [email protected]
350 silly saveTree │ │ │ └── [email protected]
350 silly saveTree │ │ └── [email protected]
350 silly saveTree │ ├── [email protected]
350 silly saveTree │ ├── [email protected]
350 silly saveTree │ └─┬ [email protected]
350 silly saveTree │ └── [email protected]
350 silly saveTree └── [email protected]
351 warn [email protected] No description
352 warn [email protected] No repository field.
353 verbose stack Error: [email protected] install: `node-gyp rebuild`
353 verbose stack spawn ENOENT
353 verbose stack at ChildProcess. (/Users/adam/.asdf/installs/nodejs/8.9.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
353 verbose stack at emitTwo (events.js:126:13)
353 verbose stack at ChildProcess.emit (events.js:214:7)
353 verbose stack at maybeClose (internal/child_process.js:925:16)
353 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
354 verbose pkgid [email protected]
355 verbose cwd /private/tmp/dummy
356 verbose Darwin 17.6.0
357 verbose argv "/Users/adam/.asdf/installs/nodejs/8.9.4/bin/node" "/Users/adam/.asdf/installs/nodejs/8.9.4/bin/npm" "i" "[email protected]"
358 verbose node v8.9.4
359 verbose npm v5.6.0
360 error file sh
361 error code ELIFECYCLE
362 error errno ENOENT
363 error syscall spawn
364 error [email protected] install: `node-gyp rebuild`
364 error spawn ENOENT
365 error Failed at the [email protected] install script.
365 error This is probably not a problem with npm. There is likely additional logging output above.
366 verbose exit [ 1, true ]
I am on fish shell. I did a clean install of asdf
from Homebrew. I took the following from this repo's README and converted it to valid fish shell.
set --export GNUPGHOME "bash /usr/local/opt/asdf/keyrings/nodejs"; and mkdir -p "$G
NUPGHOME"; and chmod 0700 "$GNUPGHOME"
I then ran the bash
command listed, but get tons of errors.
$ bash /usr/local/opt/asdf/plugins/nodejs/bin/import-release-team-keyring
gpg: keyblock resource '/Users/jesseatkinson/Dropbox (Personal)/dotfiles/bash /usr/local/opt/asdf/keyrings/nodejs/pubring.kbx': No such file or directory
gpg: failed to create temporary file '/Users/jesseatkinson/Dropbox (Personal)/dotfiles/bash /usr/local/opt/asdf/keyrings/nodejs/.#lk0x00007f8576c066b0.kh-jsatk.local.244': No such file or directory
gpg: connecting dirmngr at '/Users/jesseatkinson/Dropbox (Personal)/dotfiles/bash /usr/local/opt/asdf/keyrings/nodejs/S.dirmngr' failed: No such file or directory
gpg: keyserver receive failed: No dirmngr
# It repeats the above many times over for what I'm assuming are all the maintainers.
Also ran this
$ gpg --list-keys | tail -n -1
gpg: bad data signature from key 74BF62A5B235EAF3: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key AE4A8D7A8BA00E9E: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key DBCC98AC8D3D9557: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key CB2AF17730AA8281: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key DEA16371974031A5: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key F8598ADA6B682854: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key CEE362BFBD5FCE1D: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key 03BDCFA860AA5DCD: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key 4CB97CAF785F62C9: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key 9E915BED92E0C0FC: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key DA6D6B5B3B808A84: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key 827FF84531C45749: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key E6D30E932E659A6F: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key DA851C75F899DD2B: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key 088CD6E9D8648FC1: Wrong key usage (0x19, 0x2)
gpg: bad data signature from key 8975BA8B6100C6B1: Wrong key usage (0x19, 0x2)
Any idea why this is failing?
I'm switching to asdf from n. With both n and nvm I didn't have to deal with keyring stuff. I just ran n 8.10.0
and it installed it. So this step is confusing to me. Any help is appreciated.
I added a comment to Issue #40 about the missing key with id 821C587A.
The cause is that there is a new Node release team member with that key.
Furthermore they changed keyserver from ipv4.pool.sks-keyservers.net
to pool.sks-keyservers.net
.
A quick fix is to download the missing key with
gpg --keyserver pool.sks-keyservers.net --recv-keys 77984A986EBC2AA786BC0F66B01FBB92821C587A
but ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
should be updated with the commands at https://github.com/nodejs/node#release-team
Just like asdf-ruby has https://github.com/asdf-vm/asdf-ruby#default-gems
When running bins from global packages in the latest Node.js version, you get the error:
No such command in 10.3.0 of nodejs
# Use the latest node.js
asdf install nodejs 10.3.0
asdf global nodejs 10.3.0
# Install a package
npm install -g gh
# Generate shims
asdf reshim nodejs
# Try to run it
gh
# No such command in 10.3.0 of nodejs
The shims are made as .npm/bin/xxx
, but are now in bin/xxx
. To remedy this, you can make .npm/bin available again:
ln -nfs ../bin ~/.asdf/installs/nodejs/10.3.0/.npm/bin
Hi,
yarn can be installed alright with 'npm i -g yarn', but yarn binary does not seem to be located.
$ npm i -g yarn
/home/zenny/.asdf/installs/nodejs/8.11.1/.npm/bin/yarn -> /home/zenny/.asdf/installs/nodejs/8.11.1/.npm/lib/node_modules/yarn/bin/yarn.js
/home/zenny/.asdf/installs/nodejs/8.11.1/.npm/bin/yarnpkg -> /home/zenny/.asdf/installs/nodejs/8.11.1/.npm/lib/node_modules/yarn/bin/yarn.js
+ [email protected]
updated 1 package in 3.805s
$ which yarn
$ echo $PATH
:/home/zenny/.asdf/shims:/home/zenny/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$ yarn install
The program 'yarn' is currently not installed. You can install it by typing:
sudo apt install cmdtest
$ /home/zenny/.asdf/installs/nodejs/8.11.1/.npm/bin/yarn install
yarn install v1.7.0
[1/4] Resolving packages...
[2/4] Fetching packages...
....
Thus the absolute path to yarn works. Any inputs appreciated.
Cheers,
This is not really an issue, but I have had some local development issues when not connected to the internet and still need to run my project setup script that uses asdf
and asdf-nodejs
.
Currently, I have asdf and the nodejs binaries downloaded and cached, and my project that uses asdf to manage tool versions has a setup script that runs asdf install
and also runs this plugin's import-release-team-keyring
script, but that always hits the internet, and sometimes keyservers are unreliable even when I am connected so it stops my setup script needlessly since it exits with an error.
I've opened a pull request #44 if you're interested and think it's helpful for others.
I have nodejs 7.7.3 currently installed, I updated the plugin and I tried to install 7.9.0, but I got this message:
asdf install nodejs 7.9.0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4715 0 4715 0 0 5341 0 --:--:-- --:--:-- --:--:-- 5339
gpg: Signature made ter 11 abr 2017 16:14:50 -03
gpg: using RSA key 23EFEFE93C4CFFFE
gpg: Can't check signature: No public key
Authenticity of checksum file can not be assured! Please be sure to check the README of asdf-nodejs in case you did not yet bootstrap trust. If you already did that then that is the point to become SUSPICIOUS! There must be a reason why this is failing. If you are installing an older NodeJS version you might need to import OpenPGP keys of previous release managers. Exiting.
And it fails me with all versions I tried, 7.8.0, even 7.7.4. Am I doing something wrong?
I'm unable to install and override the global npm
package at all (i.e. replace with the latest version). I'm getting File name too long
error for many packages. This is a deal breaker for me.
Global installs are also incredibly slow which was already reported here - #46
Other than that, it's a great idea to have a single version manager. Thanks for all the efforts.
PS: nodenv handles this well and global installs are fast - might be a great source of inspiration
OS: High Sierra w/ APFS
Presently when I install nodejs 9.4.0, 9.5.0, or 9.7.1 npm v5.6.0 is installed. If I run the below command,
npm i -g npm
npm 5.7.1 is installed to
$HOME/.asdf/installs/nodejs/9.7.1/.npm/bin/npx -> $HOME/.asdf/installs/nodejs/9.7.1/.npm/lib/node_modules/npm/bin/npx-cli.js
$HOME/.asdf/installs/nodejs/9.7.1/.npm/bin/npm -> $HOME/.asdf/installs/nodejs/9.7.1/.npm/lib/node_modules/npm/bin/npm-cli.js
- [email protected]
added 533 packages in 8.269s
I then run
asdf reshim nodejs 9.7.1
but when I run npm -v
I am still presented with
5.6.0
I'm running macOS 10.12.6 if that makes a difference, and I'm running asdf v0.4.2
cheers 🍻
Chris
Right now NPM install hooks are copied to every node.js version. This makes fixing install hooks hard.
Create a simple script as the NPM install hook and call scripts in the nodejs plugin path. That's way simpler to fix and update install hooks.
Scenario:
Using asdf version v0.5.1 on a REDHAT 7.5, when i try to run (after added repo and imported OpenPGP keys as described in readme) :
$ asdf install nodejs 10.11.0
I get the following error:
~/.asdf/plugins/nodejs/bin/install: line 219: shasum: command not found.
In order to install it correctly, i simple change shasum to sha256sum and remove "-a" parameter.
I can't assure if this is the correct approach to correct this, but in my case works fine.
This appears to occur when you don't already have node.js installed (i.e. fresh system). All installs will fail as node
is not found in the $PATH when the packages are installed.
env: node: No such file or directory
, for reference.
When installing json-server, current version of this plugin installs the following file:
$ cat .asdf/shims/index
#!/usr/bin/env bash
exec /Users/justin/.asdf/bin/private/asdf-exec nodejs .npm/bin/index "$@"
The shim file should be named "json-server", and so should the path ".npm/bin/json-server".
It would then work as it is correctly installed in .asdf/installs/nodejs/4.2.1/.npm/lib/node_modules/json-server
I started trying to figure out a solution for this but haven't finished it. Opening issue so maybe someone can finish this.
In this plugin's postinstall
, I was trying to set executable_name
from npm view
's output instead of an env variable.
Something like: npm view json-server bin --json | tr -d '{} \n' | cut -d\" -f2
which outputs json-server
.
I'm not sure how to make the "json-server" arg to npm view
generic (and it could include a version or whatever else npm supports when doing npm install
- e.g. git commit hash?). I think npm view
should still be able to give the same output when using things like git commit hashes (haven't tried it). I would assume it would pick the "bin" entry in package.json for that commit.
I have tried it with a module which uses "shorthand notation" to specify it's bin
file e.g.
$ cat package.json
{
"name": "renamer",
"bin": "./index.js",
...
$ npm view ./package.json bin --json | tr -d '{} \n' | cut -d\" -f2
renamer
i.e. it works even though "bin" is not an object with key "renamer" and value "./index.js".
There is this env variable when the postinstall
runs:
npm_config_argv={"remain":["json-server"],"cooked":["install","--global","json-server"],"original":["install","-g","json-server"]}
Not sure if one can count on always parsing the "remain" value to then pass it to npm view
...
After doing: npm install -g private-bower
private-bower
is not available on the PATH. In .asdf/shims/private_bower, I can see it's doing:
exec /Users/justin/.asdf/bin/private/asdf-exec nodejs .npm/bin/private_bower "$@"
But private_bower
, although available on the PATH, gives me "No such command in 0.12.2 of nodejs".
That's because in .asdf/installs/nodejs/0.12.2/.npm/bin/, I have private-bower
not private_bower
...
To fix this I have to rename .asdf/shims/private_bower to .asdf/shims/private-bower and change it's content to use the dash:
exec /Users/justin/.asdf/bin/private/asdf-exec nodejs .npm/bin/private-bower "$@"
So, why are dashes changed to underscore when installing npm packages?
Today I upgraded from Node 6.7 to 6.8, and now my global NPM installations all say something like:
No such command in 6.8.0 of nodejs
There's no reason that my NPM modules need to be limited to the Node version that installed them. Can the commands they install not stay intact? I thought a asdf reshim nodejs
would do it but apparently not. Am I missing something?
npm
works fine when I comment out source ~/.asdf/asdf.fish
in ~/.config/fish/config.fish
and then open a new shell. When I have asdf
enabled, I get the following. Machine is Arch Linux, up to date as of now, freshly rebooted still experiencing the issue. asdf
is version 0.5, and this plugin is listed as "Already up to date.".
$ asdf current nodejs
system (set by /home/michael/.tool-versions)
$ npm
Error: EACCES: permission denied, mkdir '/.npm'
TypeError: Cannot read property 'get' of undefined
at errorHandler (/usr/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at /usr/lib/node_modules/npm/bin/npm-cli.js:76:20
at cb (/usr/lib/node_modules/npm/lib/npm.js:228:22)
at /usr/lib/node_modules/npm/lib/npm.js:266:24
at /usr/lib/node_modules/npm/lib/config/core.js:83:7
at Array.forEach (<anonymous>)
at /usr/lib/node_modules/npm/lib/config/core.js:82:13
at f (/usr/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/lib/node_modules/npm/lib/config/core.js:173:20)
at Conf.<anonymous> (/usr/lib/node_modules/npm/lib/config/core.js:229:20)
/usr/lib/node_modules/npm/lib/utils/error-handler.js:205
if (npm.config.get('json')) {
^
TypeError: Cannot read property 'get' of undefined
at process.errorHandler (/usr/lib/node_modules/npm/lib/utils/error-handler.js:205:18)
at process.emit (events.js:182:13)
at process._fatalException (internal/bootstrap/node.js:437:27)
Is this plugin currently actively maintained? When I look at the open pull requests (one of them is really critical) it does not seem that way. But I don’t want to complain and rather offer my help. Can I help in any way to maintain this and get it up to speed again?
Getting this error when attempting:
# Imports Node.js release team's OpenPGP keys to main keyring
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.