-
Notifications
You must be signed in to change notification settings - Fork 263
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
npm@5 TypeError: Cannot read property 'version' of null #298
Comments
I think this is due to npm5 using a URL value for the There's a hint in the full error output below:
Specifically, you see: Looking at the package.json files in my node_modules folder after an npm5 install, I see things like: {
"version": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz"
} So semver.parse is returning null because these aren't really semantic versioning strings, but urls of resolved packages. |
Thanks for the report and digging everyone. As the current maintainer of node-pre-gyp my preference here is to:
|
workaround: Remove the lock file.
|
Worked for me, thanks @floriantraber! |
@floriantraber Thanks! |
If you remove the lock file doesnt it just regenerate it again after running |
in my case the |
@borislemke That may work as a temporary solution, but the |
I am facing the same issue . |
Same issue in here.. |
I added |
@alexjlockwood worked like a champ |
…-work-around-node-pre-gyp-bug do not use `package-lock.json` (workaround for `node-pre-gyp` bug on npm5: mapbox/node-pre-gyp#298) (fixes #439)
I was dealing with this errors many hours until i deleted my package-lock.json file and then ran npm install again. I know the file is re-generated with each npm install but i dont get the node pre gyp errors anymore. So go figure... |
In addition to removing I was able to replicate this on OS X with:
this package.json:
And by seeding the It seems that something about the install noticing node-pre-gyp already in the Locally I've been able to solve by doing:
Which includes TryGhost/node-sqlite3@34e1a40. So, my hunch is that refs https://gist.github.com/springmeyer/96f9b937d2ecf71f8b3dc3c58b92be9b |
Thank you @floriantraber for pointing out the removal of package-lock.json. I did that and was still getting the error, but when I removed my node_modules folder and then ran npm install again, It worked. So remove both package-lock.json and node_module folder and ran npm install and that should work. |
I fixed this by updating to fsevents@1.1.2 which fixes this: fsevents/fsevents#172 |
Looks like using npm 5 we have a problem.
package_json.version
at line 262 isundefined
and throws at line 270Main NPM issue:
Related issues:
The text was updated successfully, but these errors were encountered: