2

I have the problem, that npm install always fails in my project in my continuous integration system (windows OS) because of the npm library argon2 (https://www.npmjs.com/package/argon2).

Here is the log:

...
> keytar@7.9.0 install <Path>\node_modules\keytar
> prebuild-install || npm run build

prebuild-install warn install connect ECONNREFUSED <IP:PORT>

> keytar@7.9.0 build <Path>\node_modules\keytar
> node-gyp rebuild


<Path>\node_modules\keytar>if not defined npm_config_node_gyp (node "C:\ProgramData\nvm\v14.15.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\ProgramData\nvm\v14.15.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: connect ECONNREFUSED <IP:PORT>
gyp ERR! stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\ProgramData\\nvm\\v14.15.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd <Path>\node_modules\keytar
gyp ERR! node -v v14.15.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keytar@7.9.0 build: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the keytar@7.9.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     <Path>\npm-cache\_logs\2022-07-14T13_17_19_027Z-debug.log

> argon2@0.27.2 install <Path>\node_modules\argon2
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! install request to https://github.com/ranisalt/node-argon2/releases/download/v0.27.2/argon2-v0.27.2-napi-v3-win32-x64-unknown.tar.gz failed, reason: connect ECONNREFUSED 140.82.121.4:443 
node-pre-gyp WARN Pre-built binaries not installable for argon2@0.27.2 and node@14.15.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error request to https://github.com/ranisalt/node-argon2/releases/download/v0.27.2/argon2-v0.27.2-napi-v3-win32-x64-unknown.tar.gz failed, reason: connect ECONNREFUSED 140.82.121.4:443 
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: connect ECONNREFUSED <IP:PORT>
gyp ERR! stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\ProgramData\\nvm\\v14.15.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=<Path>\\node_modules\\argon2\\lib\\binding\\napi-v3\\argon2.node" "--module_name=argon2" "--module_path=<Path>\\node_modules\\argon2\\lib\\binding\\napi-v3" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd <Path>\node_modules\argon2
gyp ERR! node -v v14.15.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\ProgramData\nvm\v14.15.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=<Path>\node_modules\argon2\lib\binding\napi-v3\argon2.node --module_name=argon2 --module_path=<Path>\node_modules\argon2\lib\binding\napi-v3 --napi_version=7 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (<Path>\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "<Path>\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd <Path>\node_modules\argon2
node-pre-gyp ERR! node -v v14.15.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.9
node-pre-gyp ERR! not ok
...

I think it is related to the proxy problem, such that the request to GitHub for getting the prebuild binaries does not work. How can I avoid downloading the prebuild binaries in my continuous integration system? Can I download them locally, commit them to my project somewhere?

The project in the continuous integration system is already connected to an internal npm registry.

Siminho
  • 109
  • 1
  • 2
  • 6

0 Answers0