TypeError: Cannot read property 'node' of undefined
I am trying to install NPM.
First I ran
brew install node
then
curl -O https://www.npmjs.org/install.sh
then
~ % sh install.sh
this is what i get
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
install npm@latest
fetching: http://registry.npmjs.org/npm/-/npm-2.0.2.tgz
/private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/bin/read-package-json.js:18
val = val[f]
^
TypeError: Cannot read property 'node' of undefined
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/bin/read-package-json.js:18:16
at Array.forEach (native)
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/bin/read-package-json.js:17:11
at Array.forEach (native)
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/bin/read-package-json.js:14:22
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/node_modules/read-package-json/read-json.js:51:40
at final (/private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/node_modules/read-package-json/read-json.js:349:17)
at then (/private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/node_modules/read-package-json/read-json.js:126:33)
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/node_modules/read-package-json/read-json.js:266:40
at evalmachine.<anonymous>:271:14
0.10.32
/private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/bin/read-package-json.js:18
val = val[f]
^
TypeError: Cannot read property 'node' of undefined
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/bin/read-package-json.js:18:16
at Array.forEach (native)
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/bin/read-package-json.js:17:11
at Array.forEach (native)
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/bin/read-package-json.js:14:22
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/node_modules/read-package-json/read-json.js:51:40
at final (/private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/node_modules/read-package-json/read-json.js:349:17)
at then (/private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/node_modules/read-package-json/read-json.js:126:33)
at /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package/node_modules/read-package-json/read-json.js:266:40
at evalmachine.<anonymous>:271:14
> npm@2.0.2 prepublish /private/var/folders/92/2l_j234x7n7bys14466b4dcr0000gn/T/npm.12852/package
> node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test/*/*/node_modules && make -j8 doc
make: Nothing to be done for `doc'.
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm@2.0.2 /usr/local/lib/node_modules/npm
It worked
I know he says it worked ... I'm just trying to figure out what the error message means. And see what I can do to fix this.
Any ideas?
Thanks for the help!
+3
source to share
1 answer
While it looks like you've got it all figured out, I'd like to answer this question by suggesting the "official" (npm-supported) way to install npm on OSX:
- do not use
brew
; - install the "official" node binary from https://nodejs.org/download
- install the latest version
npm
:sudo npm install -g npm@latest
If you install it this way, it's easier to get support for npm
tracking issues https://github.com/npm/npm
0
source to share