cryptocoinjs / secp256k1-node

Node.js binding for an Optimized C library for EC operations on curve secp256k1
Other
341 stars 120 forks source link

node-gyp issue #178

Closed ItFlyingStart closed 3 years ago

ItFlyingStart commented 3 years ago

I got the next error when running npm install for Solana Hello World example and have tried the next solution: https://github.com/nodejs/node-gyp/wiki/Updating-npm%27s-bundled-node-gyp, but it doesn't resolve this issue. Can you help?

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'helloworld@0.0.1',
npm WARN EBADENGINE   required: { node: '12.x' },
npm WARN EBADENGINE   current: { node: 'v16.0.0', npm: '7.11.2' }
npm WARN EBADENGINE }
npm WARN deprecated @types/yaml@1.9.7: This is a stub types definition. yaml provides its own type definitions, so you do not need this installed.
npm ERR! code 1
npm ERR! path /home/ryan/Blockchains/solana-labs/example-helloworld/node_modules/secp256k1
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/home/ryan/Blockchains/solana-labs/example-helloworld/node_modules/secp256k1/build'
npm ERR!   CC(target) Release/obj.target/secp256k1/src/secp256k1/src/secp256k1.o
npm ERR!   AR(target) Release/obj.target/secp256k1.a
npm ERR!   COPY Release/secp256k1.a
npm ERR!   CXX(target) Release/obj.target/addon/src/addon.o
npm ERR! make: Leaving directory '/home/ryan/Blockchains/solana-labs/example-helloworld/node_modules/secp256k1/build'
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@16.0.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.9.4 found at "/usr/bin/python3"
npm ERR! gyp WARN EACCES current user ("ryan") does not have permission to access the dev dir "/root/.cache/node-gyp/16.0.0"
npm ERR! gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp"
npm ERR! (node:44353) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/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/ryan/Blockchains/solana-labs/example-helloworld/node_modules/secp256k1/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/tmp/.node-gyp/16.0.0/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=/tmp/.node-gyp/16.0.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/tmp/.node-gyp/16.0.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/ryan/Blockchains/solana-labs/example-helloworld/node_modules/secp256k1',
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 info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! warning: unknown warning option '-Wno-nonnull-compare' [-Wunknown-warning-option]
npm ERR! 1 warning generated.
npm ERR! make: g++: No such file or directory
npm ERR! make: *** [addon.target.mk:119: Release/obj.target/addon/src/addon.o] Error 127
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.11.0-16-generic
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/ryan/Blockchains/solana-labs/example-helloworld/node_modules/secp256k1
npm ERR! gyp ERR! node -v v16.0.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

Environment Ubuntu 21.04 solana-cli 1.6.6 node v16.0.0 npm 7.11.2 rustup 1.24.1 rustc 1.51.0 cargo 1.51.0

ItFlyingStart commented 3 years ago

It seems related to node v16. It works with node v14.