mapbox / mapbox/node-pre-gyp

npm@5 TypeError: Cannot read property 'version' of null

Open
#298 16 comments 63 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.2k
Forks
271
Avg merge
23h 40m
Merged PRs (30d)
2

Description

Looks like using npm 5 we have a problem.

`package_json.version` at [line 262](https://github.com/mapbox/node-pre-gyp/blob/master/lib/util/versioning.js#L262) is `undefined` and [throws at line 270](https://github.com/mapbox/node-pre-gyp/blob/master/lib/util/versioning.js#L270)

```
TypeError: Cannot read property 'version' of null
at Object.module.exports.evaluate (/Users/yvele/repo/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/versioning.js:270:32)
at install (/Users/yvele/repo/node_modules/fsevents/node_modules/node-pre-gyp/lib/install.js:168:31)
at Object.self.commands.(anonymous function) [as install] (/Users/yvele/repo/node_modules/fsevents/node_modules/node-pre-gyp/lib/node-pre-gyp.js:50:37)
at run (/Users/yvele/repo/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp:79:30)
at Object. (/Users/yvele/repo/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp:131:1)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
```

-----

Main NPM issue:
- https://github.com/npm/npm/issues/16926

Related issues:
- https://github.com/electron-userland/electron-prebuilt/issues/258
- https://github.com/strongloop/fsevents/issues/172
- https://github.com/appcelerator/titanium_mobile/pull/9048
- https://github.com/vuejs-templates/pwa/issues/30

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/util/versioning.js at lines 262 and 270, then reproduce the reported install path with npm 5. Read the linked npm issue and related reports for compatibility context. Done should mean the npm 5 installation no longer raises the reported TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.