Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install @bitwarden/cli (20.9.x) with npm #6589

Closed
1 task done
ttdatt opened this issue Oct 16, 2023 · 1 comment
Closed
1 task done

Can't install @bitwarden/cli (20.9.x) with npm #6589

ttdatt opened this issue Oct 16, 2023 · 1 comment
Labels
bug cli CLI Application

Comments

@ttdatt
Copy link

ttdatt commented Oct 16, 2023

Steps To Reproduce

MacOS: 14.0
node: 20.8.0
npm: 10.2.0

Run npm i -g @bitwarden/cli

I can install npm i -g @bitwarden/cli@2023.8.2 successfully

Expected Result

Install successfully

Look like it's same as #6458

Actual Result

➜  npm i -g @bitwarden/cli
npm WARN deprecated @babel/plugin-proposal-export-namespace-from@7.18.9: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
npm WARN deprecated @koa/router@12.0.0: **IMPORTANT 10x+ PERFORMANCE UPGRADE**: Please upgrade to v12.0.1+ as we have fixed an issue with debuglog causing 10x slower router benchmark performance, see https://github.com/koajs/router/pull/173
npm ERR! code 1
npm ERR! path /Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! CC(target) Release/obj.target/libargon2/argon2/src/ref.o
npm ERR!   CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
npm ERR!   CC(target) Release/obj.target/libargon2/argon2/src/core.o
npm ERR!   CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
npm ERR!   CC(target) Release/obj.target/libargon2/argon2/src/thread.o
npm ERR!   CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
npm ERR!   LIBTOOL-STATIC Release/argon2.a
npm ERR!   CXX(target) Release/obj.target/argon2/argon2_node.o
npm ERR! Failed to execute '/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/bin/node /Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2/lib/binding/napi-v3 --napi_version=9 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp@1.0.11
npm ERR! node-pre-gyp info using node@20.8.0 | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2/lib/binding/napi-v3/argon2.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/v0.31.0/argon2-v0.31.0-napi-v3-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.31.0/argon2-v0.31.0-napi-v3-darwin-arm64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for argon2@0.31.0 and node@20.8.0 (node-v115 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.31.0/argon2-v0.31.0-napi-v3-darwin-arm64-unknown.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@20.8.0 | darwin | arm64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@20.8.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.5 found at "/opt/homebrew/opt/python@3.11/bin/python3.11"
npm ERR! gyp info spawn /opt/homebrew/opt/python@3.11/bin/python3.11
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/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   '/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/Users/trandat/Library/Caches/node-gyp/20.8.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=/Users/trandat/Library/Caches/node-gyp/20.8.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/trandat/Library/Caches/node-gyp/20.8.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2',
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 ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@20.8.0 | darwin | arm64
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! clang: error: no such file or directory: 'Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/node-addon-api'
npm ERR! make: *** [Release/obj.target/argon2/argon2_node.o] Error 1
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 (/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Darwin 23.0.0
npm ERR! gyp ERR! command "/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/bin/node" "/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2/lib/binding/napi-v3/argon2.node" "--module_name=argon2" "--module_path=/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2/lib/binding/napi-v3" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd /Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2
npm ERR! gyp ERR! node -v v20.8.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/bin/node /Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2/lib/binding/napi-v3 --napi_version=9 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm ERR! node-pre-gyp ERR! System Darwin 23.0.0
npm ERR! node-pre-gyp ERR! command "/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/bin/node" "/Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Users/trandat/Library/Application Support/fnm/node-versions/v20.8.0/installation/lib/node_modules/@bitwarden/cli/node_modules/argon2
npm ERR! node-pre-gyp ERR! node -v v20.8.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm ERR! node-pre-gyp ERR! not ok

Screenshots or Videos

No response

Additional Context

No response

Operating System

macOS

Operating System Version

14.0

Shell

Zsh

Build Version

2023.9.1

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
@ttdatt ttdatt added bug cli CLI Application labels Oct 16, 2023
@ttdatt ttdatt changed the title Can't install @bitwarden/cli with npm Can't install @bitwarden/cli (20.9.1) with npm Oct 16, 2023
@ttdatt ttdatt changed the title Can't install @bitwarden/cli (20.9.1) with npm Can't install @bitwarden/cli (20.9.x) with npm Oct 16, 2023
@atjbramley
Copy link
Contributor

Hi @ttdatt ,

I attempted to reproduce your issue and was unable to do so. Specifically:

  • on a mac with macOS Sonoma 14.0
  • I installed npm and nvm versions matching your own and configured these to be used
  • I uninstalled the @bitwarden/cli package globally and verified that it was no longer present
  • I rebooted
  • I installed the @bitwarden/cli package successfully.

I think your error could have its origin in a misconfiguration or corruption of your node/nvm setup.

We use GitHub issues as a place to track bugs and other development related issues. If your issue persists, please write us back using our contact form, so we can continue troubleshooting: https://bitwarden.com/contact/

You can include a link to this issue in the message content.

Alternatively, you can also search for an answer in our help documentation (https://bitwarden.com/help/) or get help from other Bitwarden users on our community forums (https://community.bitwarden.com/c/support/).

The issue here will be closed.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli CLI Application
Projects
None yet
Development

No branches or pull requests

2 participants