better error message if node-gyp or nw-gyp is not found
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 271
- Avg merge
- 23h 40m
- Merged PRs (30d)
- 2
Description
Currently you just get something very verbose, but generic:
```
gyp ERR! cwd /home/ubuntu/node-sqlite3
gyp ERR! node -v v0.10.30
gyp ERR! nw-gyp -v v0.12.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'nw-gyp rebuild --name=sqlite3 --configuration=Release --module_name=node_sqlite3 --version=2.2.4 --major=2 --minor=2 --patch=4 --runtime=node-webkit --node_abi=node-webkit-nw0.8.6 --target=0.8.6 --platform=linux --target_platform=linux --arch=ia32 --target_arch=ia32 --module_main=./lib/sqlite3 --host=https://node-sqlite3.s3.amazonaws.com/ --module_path=/home/ubuntu/node-sqlite3/lib/binding/node-webkit-nw0.8.6-linux-ia32 --remote_path=./Release/ --package_name=node_sqlite3-v2.2.4-node-webkit-nw0.8.6-linux-ia32.tar.gz --staged_tarball=build/stage/Release/node_sqlite3-v2.2.4-node-webkit-nw0.8.6-linux-ia32.tar.gz --hosted_path=https://node-sqlite3.s3.amazonaws.com/Release/ --hosted_tarball=https://node-sqlite3.s3.amazonaws.com/Release/node_sqlite3-v2.2.4-node-webkit-nw0.8.6-linux-ia32.tar.gz' (1)
node-pre-gyp ERR! stack at ChildProcess. (/home/ubuntu/node-sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:76:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:756:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:823:5)
node-pre-gyp ERR! System Linux 3.2.0-64-virtual
node-pre-gyp ERR! command "node" "/home/ubuntu/node-sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/ubuntu/node-sqlite3
node-pre-gyp ERR! node -v v0.10.30
node-pre-gyp ERR! node-pre-gyp -v v0.6.0
node-pre-gyp ERR! not ok
Failed to execute 'nw-gyp rebuild --name=sqlite3 --configuration=Release --module_name=node_sqlite3 --version=2.2.4 --major=2 --minor=2 --patch=4 --runtime=node-webkit --node_abi=node-webkit-nw0.8.6 --target=0.8.6 --platform=linux --target_platform=linux --arch=ia32 --target_arch=ia32 --module_main=./lib/sqlite3 --host=https://node-sqlite3.s3.amazonaws.com/ --module_path=/home/ubuntu/node-sqlite3/lib/binding/node-webkit-nw0.8.6-linux-ia32 --remote_path=./Release/ --package_name=node_sqlite3-v2.2.4-node-webkit-nw0.8.6-linux-ia32.tar.gz --staged_tarball=build/stage/Release/node_sqlite3-v2.2.4-node-webkit-nw0.8.6-linux-ia32.tar.gz --hosted_path=https://node-sqlite3.s3.amazonaws.com/Release/ --hosted_tarball=https://node-sqlite3.s3.amazonaws.com/Release/node_sqlite3-v2.2.4-node-webkit-nw0.8.6-linux-ia32.tar.gz' (1)
npm ERR! sqlite3@2.2.4 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@2.2.4 install script.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.0-64-virtual
npm ERR! command "/home/ubuntu/.nvm/v0.10.30/bin/node" "/home/ubuntu/.nvm/v0.10.30/bin/npm" "install" "--build-from-source" "--runtime=node-webkit" "--target=0.8.6" "--target_arch=ia32"
npm ERR! cwd /home/ubuntu/node-sqlite3
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ubuntu/node-sqlite3/npm-debug.log
npm ERR! not ok code 0
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at node_modules/node-pre-gyp/lib/util/compile.js:76, the stack location shown in the report, and reproduce an install where node-gyp or nw-gyp is unavailable. Done means the install reports a specific missing-tool error instead of only the generic verbose build failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100