google / pprof-nodejs

pprof support for Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error installing pprof with nodejs v14

wolf-rafael-lfr opened this issue · comments

Error:

❯ npm install pprof --save                        
npm ERR! code 1
npm ERR! path /home/wolf/dev/liferay-cloud-api/api/node_modules/pprof
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@14.15.4 | linux | x64
npm ERR! gyp info find Python using Python version 3.6.9 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/wolf/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/wolf/dev/liferay-cloud-api/api/node_modules/pprof/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/wolf/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/wolf/.cache/node-gyp/14.15.4/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/wolf/.cache/node-gyp/14.15.4',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/wolf/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/wolf/.cache/node-gyp/14.15.4/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/wolf/dev/liferay-cloud-api/api/node_modules/pprof',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/home/wolf/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Linux 5.4.0-65-generic
npm ERR! gyp ERR! command "/home/wolf/.nvm/versions/node/v14.15.4/bin/node" "/home/wolf/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/wolf/dev/liferay-cloud-api/api/node_modules/pprof
npm ERR! gyp ERR! node -v v14.15.4
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

❯ python -V
Python 3.6.9

❯ gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

❯ node -v
v14.15.4

❯ npm -v
7.5.6

I did install node-gyp globally already

Can I have some help?
Thanks


Rafael

Thanks for reporting this.

I'm surprised to see this failure occur on a linux platform with x64 architecture, since we should have pre-built binaries available (so node-gyp shouldn't need be used). If your not currently installing v3.0.0, that might explain this issue (since, I believe that's the first version of pprof with prebuilt binaries for Node 14), otherwise, I'm not sure why this is occurring

StillI can reproduce this when I run npm install pprof when using the v8 canary version. The relevant portion of the error seems to be npm ERR! gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp It's suggested in this issue that this is related to node-pre-gyp.

Looking at https://www.npmjs.com/package/node-pre-gyp, it seems like we need to switch to @mapbo/node-pre-gyp. I don't know if that's part of the issue, though.

I'm no longer able to reproduce this, so am closing this issue.
If this continues to occur for you, please re-open this issue