3

while install heapdump using nodejs I am facing below error message. I have installed python on the system also. I have to install heapdump package in node_module. Below is the part of package.json where i have specified the heapdump version. "grunt-shell": "^0.6.4", "heapdump": "^0.3.4"

error:
[06:26:28][Step 4/8] npm http 304 https://registry.npmjs.org/getobject

[06:26:28][Step 4/8] npm ERR! heapdump@0.3.5 install: `node-gyp rebuild`

[06:26:28][Step 4/8] npm ERR! Exit status 1

[06:26:28][Step 4/8] npm ERR! 

[06:26:28][Step 4/8] npm ERR! Failed at the heapdump@0.3.5 install script.

[06:26:28][Step 4/8] npm ERR! This is most likely a problem with the heapdump package,

[06:26:28][Step 4/8] npm ERR! not with npm itself.

[06:26:28][Step 4/8] npm ERR! Tell the author that this fails on your system:

[06:26:28][Step 4/8] npm ERR!     node-gyp rebuild

[06:26:28][Step 4/8] npm ERR! You can get their info via:

[06:26:28][Step 4/8] npm ERR!     npm owner ls heapdump

[06:26:28][Step 4/8] npm ERR! There is likely additional logging output above.

[06:26:28][Step 4/8] 

[06:26:28][Step 4/8] npm ERR! System Windows_NT 6.1.7601

[06:26:28][Step 4/8] npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"

[06:26:28][Step 4/8] npm ERR! cwd C:\TeamCity\buildAgent\work\60663b0f150483a8\smoke

[06:26:29][Step 4/8] npm ERR! node -v v0.10.22

[06:26:29][Step 4/8] npm ERR! npm -v 1.3.14

[06:26:29][Step 4/8] npm ERR! code ELIFECYCLE
t
user3118131
  • 71
  • 1
  • 6

3 Answers3

0

You have not specified the operating system in your question but the error trace shows Windows_NT 6.1.7601.

There may be more than one reason for its failure.

node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js. So when you try to install heapdump, internally it uses 'node-gyp' to rebuild the module for your particular platform (windows/unix/mac etc). One possible reason is the version of python used. Python v2.7 recommended, v3.x.x is not supported. If this is the case you will get the error like the below.

gyp ERR! configure error
gyp ERR! stack Error: Python executable "python" is v3.5.1, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.

To solve this issue you can use the npm install python switch as below.

npm install --python=python2.7

Other reason for failure is specific to OS. If you are installing this on Windows you should have Microsoft Visual Studio C++ 2013 (XP/7/8 etc) or Visual Studio Community 2015 Edition(Windows 10). Read this link to understand more

Binu George
  • 1,050
  • 10
  • 14
0

I have had a same problem when installing heapdump@^0.3.12 package, npm used node gyb to rebuild package. I changed python version , installed visual bla bla.... but it didn't worked. Then I used another device with another npm and node version, it worked. I think cause of the problem is node and npm version. I upgraded them then it worked in my device. Before: node: 10.15.3 After: node: 14.16.1 npm: 6.9.2 npm: 6.14.12 There is a recommendation here. Latest version maybe can't help you, let try with some near version.

0

Please check node version is correct and try to reinstall node_modules.

Margi212
  • 143
  • 1
  • 10