Issue with node-pre-gyp while installing argon2 on Mac

1.3k Views Asked by At

I'm trying to install argon2 with yarn add argon2 and get this following error.

What I have done:

  • Installed v8.4.1 of node-gyp
  • Installed mapbox/node-pre-gyp v1.0.9
  • Manually added node-pre-gyp v "0.17.0" into devDeps

However the issue still persists.

Command: node-pre-gyp install --fallback-to-build
Arguments: 
Directory: 
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | arm64
node-pre-gyp info check checked for "" (not found)
node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/v0.28.5/argon2-v0.28.5-napi-v3-darwin-arm64-unknown.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.28.5/argon2-v0.28.5-napi-v3-darwin-arm64-unknown.tar.gz 
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.28.5/argon2-v0.28.5-napi-v3-darwin-arm64-unknown.tar.gz 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.9.10 found at "/opt/homebrew/opt/[email protected]/bin/python3.9"
gyp info spawn /opt/homebrew/opt/[email protected]/bin/python3.9
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/" "--module_name=argon2" "--module_path=" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd 
gyp ERR! node -v v16.14.2
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module= --module_name=argon2 --module_path= --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> 
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1092:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
node-pre-gyp ERR! System Darwin 20.3.0
node-pre-gyp ERR! command "/usr/local/bin/node" "" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd 
node-pre-gyp ERR! node -v v16.14.2
node-pre-gyp ERR! node-pre-gyp -v v1.0.9
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=```
1

There are 1 best solutions below

0
On

This is resolved by downgrade my node version from 16x to 14. I use n for node version management https://github.com/tj/n/tree/5b4a526ec71a8b9c4e9af909487565b35e803fe8