mapbox / mapbox/node-pre-gyp

TypeError: Cannot read property 'apply' of undefined

Open
#605 0 comments 0 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

Hi all, I am trying install sqlite3, however, it is failed. I think that the root cause is needle version, needle 2.9.0 is not working for node-pre-gyp.

node npm install sqlite3@^4.0.0

> sqlite3@4.2.0 install /home/william.chang/AAA/BBB/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp ERR! UNCAUGHT EXCEPTION
node-pre-gyp ERR! stack TypeError: Cannot read property 'apply' of undefined
node-pre-gyp ERR! stack at ClientRequest. (/home/william.chang/AAA/BBB/node_modules/node-pre-gyp/node_modules/needle/lib/needle.js:618:20)
node-pre-gyp ERR! stack at ClientRequest.g (events.js:291:16)
node-pre-gyp ERR! stack at emitOne (events.js:96:13)
node-pre-gyp ERR! stack at ClientRequest.emit (events.js:188:7)
node-pre-gyp ERR! stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:474:21)
node-pre-gyp ERR! stack at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
node-pre-gyp ERR! stack at TLSSocket.socketOnData (_http_client.js:363:20)
node-pre-gyp ERR! stack at emitOne (events.js:96:13)
node-pre-gyp ERR! stack at TLSSocket.emit (events.js:188:7)
node-pre-gyp ERR! stack at readableAddChunk (_stream_readable.js:176:18)
node-pre-gyp ERR! System Linux 3.10.0-1160.el7.x86_64
node-pre-gyp ERR! command "/home/william.chang/AAA/tools/nodejs-v6/target/bin/node" "/home/william.chang/AAA/BBB/n
ode_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/william.chang/AAA/BBB/node_modules/sqlite3
node-pre-gyp ERR! node -v v6.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!
npm WARN auth_server@1.0.0 No repository field.
npm ERR! Linux 3.10.0-1160.el7.x86_64
npm ERR! argv "/home/william.chang/AAA/tools/nodejs-v6/target/bin/node" "/home/william.chang/AAA/tools/nodejs-v6/target/bin/npm" "install" "sqlite3@^4.0.0"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! sqlite3@4.2.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the sqlite3@4.2.0 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR! npm bugs sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/william.chang/AAA/BBB/npm-debug.log

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 by reproducing `npm install sqlite3@^4.0.0` with Node v6.10.0 and node-pre-gyp v0.11.0, then inspect `node_modules/node-pre-gyp/node_modules/needle/lib/needle.js` around line 618. Compare the failure with the reported Needle version and verify that the installation no longer raises the `apply` TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, sqlite
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.