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

Node 4.0.0 - Require heapdump - Cannot find module '../build/Debug/addon' #66

Closed
rainabba opened this issue Sep 17, 2015 · 9 comments
Closed

Comments

@rainabba
Copy link

Was working fine with node 0.12.7. With Node 4.0.0, I get the follow just requiring heapdump.

Error

Error: Cannot find module '../build/Debug/addon'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Function.cls_wrapMethod [as _load] (projectRoot\node_modules\newrelic\lib\shimmer.js:230:38)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (projectRoot\node_modules\heapdump\lib\main.js:18:15)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.cls_wrapMethod [as _load] (projectRoot\node_modules\newrelic\lib\shimmer.js:230:38)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (projectRoot\lib\plugins\registerPoop.js:5:16)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)

registerPoop:5

var HeapDump = require('heapdump');
@bnoordhuis
Copy link
Owner

What does env V=1 npm install heapdump print? What does find node_modules/heapdump/build print afterwards?

@rainabba
Copy link
Author

> heapdump@0.3.7 install projectRoot\node_modules\heapdump
> node-gyp rebuild


projectRoot\node_modules\heapdump>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node  rebuild )
gyp: C:\users\myuserName\.node-gyp\4.0.0\common.gypi not found (cwd: projectRoot\node_modules\heapdump) while reading includes of binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:355:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd projectRoot\node_modules\heapdump
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "heapdump"
npm ERR! node v4.0.0
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE

npm ERR! heapdump@0.3.7 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the heapdump@0.3.7 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the heapdump package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls heapdump
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     projectRoot\npm-debug.log

The 2nd led me to realize that it wasn't installed properly and when I tried explicitly, I got the same error as above.

@rainabba
Copy link
Author

This is either an issue with the node-gyp build script in heapdump or node-gyp itself (perhaps from my environment). Checking there with issue: nodejs/node-gyp#735

@rainabba rainabba reopened this Sep 17, 2015
@rainabba
Copy link
Author

#53 looks related

@bnoordhuis
Copy link
Owner

gyp: C:\users\myuserName.node-gyp\4.0.0\common.gypi not found (cwd: projectRoot\node_modules\heapdump) while reading includes of binding.gyp while trying to load binding.gyp

That error means there's something wrong with your setup. Try deleting the .node-gyp directory and rerun npm install. Make sure you're using the npm and node-gyp that came with node v4.

I'm going to close the issue, we're not looking at a heapdump bug.

@rainabba
Copy link
Author

While C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp had 3.0.3, C:\Users\myusername\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp had 2.0.2.

I emptied the older folder and copied over the contents of the newer. Seems that npm isn't dealing well with the fact that there's the system node_modules AND user account node_modules THEN the actual project.

Now heapdump installs fine.

@CrabDude
Copy link

FYI, this error occurs when upgrading node.js (i.e., 4->6) & not npm rebuilding. I came here looking for more info cuz I didn't recall it being a typical binary install issue when upgrading.

@dblock
Copy link

dblock commented Apr 5, 2017

Running npm rebuild suggested by @CrabDude solved my problem.

@mtaylor769
Copy link

npm rebuild also worked for me. I've had sporadic problems with the 'bcrypt' library and this seems to have fixed that issue as well. Thanks @CrabDude !

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

5 participants