Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.6] - meteor npm i - Cannot read property '0' of undefined #9333

Closed
zeroasterisk opened this issue Nov 9, 2017 · 7 comments
Closed

[1.6] - meteor npm i - Cannot read property '0' of undefined #9333

zeroasterisk opened this issue Nov 9, 2017 · 7 comments
Milestone

Comments

@zeroasterisk
Copy link

zeroasterisk commented Nov 9, 2017

Bug:

I had this when testing rc for 1.6 (mentioned in the PR thread)

I am now testing the actual 1.6 release, and I'm getting the same thing:

Cannot read property '0' of undefined

This is very similar to #9319 but not exactly the same, not related to lodash/underscore.

npm debug log for: meteor npm i
http://sebsauvage.net/paste/?ed554c3cb23a93d8#HAsff8J+quOmXQNqnKdARP+leXFhCcZmNO1fdsUSOxI=

npm debug log for: meteor npm i react-rangeslider --save
http://sebsauvage.net/paste/?127b43824386dd16#8tPHLT4cSWYYyqelzETfsQwBJnv2LuLAzkS4Z72ENQU=

$ meteor --version && meteor npm --version && uname -a
Meteor 1.6
5.4.2
Darwin alan 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64 i386 MacBookPro11,5 Darwin

NOTE:

If I trash all meteor linker files and node_modules, I can then run npm commands again

$ rm -rf .meteor/local/bundler-cache/linker && rm -rf node_modules
$ meteor npm i react-rangeslider --save

> dtrace-provider@0.8.5 install /Users/alan/Code/eltoro/portalV2/webapp/node_modules/bunyan/node_modules/dtrace-provider
> node scripts/install.js


> fsevents@1.1.2 install /Users/alan/Code/eltoro/portalV2/webapp/node_modules/fsevents
> node install

[fsevents] Success: "/Users/alan/Code/eltoro/portalV2/webapp/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> bcrypt@1.0.3 install /Users/alan/Code/eltoro/portalV2/webapp/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

[bcrypt] Success: "/Users/alan/Code/eltoro/portalV2/webapp/node_modules/bcrypt/lib/binding/bcrypt_lib.node" is installed via remote

> node-sass@4.5.3 install /Users/alan/Code/eltoro/portalV2/webapp/node_modules/node-sass
> node scripts/install.js

Cached binary found at /Users/alan/.npm/node-sass/4.5.3/darwin-x64-57_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall /Users/alan/Code/eltoro/portalV2/webapp/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.5.3 postinstall /Users/alan/Code/eltoro/portalV2/webapp/node_modules/node-sass
> node scripts/build.js

Binary found at /Users/alan/Code/eltoro/portalV2/webapp/node_modules/node-sass/vendor/darwin-x64-57/binding.node
Testing binary
Binary is fine
+ react-rangeslider@2.2.0
added 2019 packages in 37.763s

but it errors out again, immediately after:

$ meteor npm i
npm ERR! Cannot read property '0' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alan/.npm/_logs/2017-11-09T16_22_14_531Z-debug.log
@zeroasterisk
Copy link
Author

zeroasterisk commented Nov 9, 2017

NOTE: I have tried to create a reproduction repo here

$ meteor create meteor-issue-9333
$ cd meteor-issue-9333
$ cp <path>.meteor/packages .meteor/
$ cp <path>.package.json ./
$ meteor npm i
$ meteor
...
$ meteor npm i
up to date in 6.38s
$ meteor npm i react-rangeslider --save
+ react-rangeslider@2.2.0
added 2 packages in 7.91s

it does not demonstrate the same bug... perhaps I need to actually make it work and use the packages in the app code?

recommendations on recreation?

@QHose
Copy link

QHose commented Nov 9, 2017

hi, delete your node modules dir and run meteor npm install --save and next run meteor again.

@yanickrochon
Copy link

This issue is discussed here, here, here, here, etc. 😛 Basically, it's an npm issue, not Meteor.

@zeroasterisk
Copy link
Author

@QHose I did that several times, but I never included the --save on the blank npm install command.

So I tried it again
rm -rf node_modules && meteor npm install --save

Same error:

npm ERR! Cannot read property '0' of undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/alan/.npm/_logs/2017-11-09T17_52_02_979Z-debug.log

@abernix abernix changed the title Meteor 1.6 - meteor npm i - Cannot read property '0' of undefined [1.6] - meteor npm i - Cannot read property '0' of undefined Nov 15, 2017
@peernohell
Copy link

@zeroasterisk In addition to remove the node_modules can you try to remove the package-lock.json
and then make a meteor npm install?
it's solved the issue for me

@hwillson
Copy link
Contributor

Looks like this issue has been fixed upstream (npm/npm#17858 (comment)) and is coming in the next npm release.

@hwillson
Copy link
Contributor

This was fixed in npm 5.6.0, which is included with Meteor 1.6.1. Closing - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants