nvm: Manjaro: `nvm is not compatible with the npm config "prefix" option: currently set to ""`
All of a sudden nvm stopped working 😦 I’ve done a clean install of nvm
. It goes well. Then when I do nvm install lts/dubnium
I get the following error.
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `npm config delete prefix` or `nvm use --delete-prefix v10.15.0` to unset it.
Since, lts/dubnium
was successfully installed, I also tried nvm use lts/dubnium
I get the same error.
If I run nvm use --delete-prefix v10.15.0
, then the system node get used, and I cannot get it to use lts/dubnium
.
There is no .npmrc
file. I use zsh.
-
Operating system and version:
4.19.12-2-MANJARO #1 SMP PREEMPT x86_64 GNU/Linux
-
nvm debug
output:
nvm --version: v0.33.11
$SHELL: /bin/zsh
$SHLVL: 1
$HOME: /home/naturgewalt
$NVM_DIR: '$HOME/.nvm'
$PATH: /usr/local/bin:/usr/local/sbin:/usr/bin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/opt/android-sdk/tools/bin:/opt/cuda/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin:$HOME/.gem/ruby/2.5.0/bin
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.6.2 (x86_64-pc-linux-gnu)'
uname -a: 'Linux 4.19.12-2-MANJARO #1 SMP PREEMPT Sun Dec 23 19:08:00 UTC 2018 x86_64 GNU/Linux'
OS version: Manjaro Linux () ()
curl: /usr/bin/curl, curl 7.62.0 (x86_64-pc-linux-gnu) libcurl/7.62.0 OpenSSL/1.1.1a zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) libssh2/1.8.0 nghttp2/1.34.0
wget: /usr/bin/wget, GNU Wget 1.19.5 built on linux-gnu.
git: /usr/bin/git, git version 2.19.2
grep: grep: aliased to grep --color=auto (grep --color=auto), grep (GNU grep) 3.1
awk: /usr/bin/awk, GNU Awk 4.2.1, API: 2.0 (GNU MPFR 4.0.1, GNU MP 6.1.2)
sed: /usr/bin/sed, sed (GNU sed) 4.5
cut: /usr/bin/cut, cut (GNU coreutils) 8.30
basename: /usr/bin/basename, basename (GNU coreutils) 8.30
rm: /usr/bin/rm, rm (GNU coreutils) 8.30
mkdir: /usr/bin/mkdir, mkdir (GNU coreutils) 8.30
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.6.0
nvm current: system
which node: /usr/bin/node
which iojs: iojs not found
which npm: /usr/bin/npm
npm config get prefix: /usr
npm root -g: /usr/lib/node_modules
nvm ls
output:
v10.15.0
-> system
default -> lts/dubnium (-> v10.15.0)
node -> stable (-> v10.15.0) (default)
stable -> 10.15 (-> v10.15.0) (default)
iojs -> N/A (default)
lts/* -> lts/dubnium (-> v10.15.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.16.0 (-> N/A)
lts/carbon -> v8.15.0 (-> N/A)
lts/dubnium -> v10.15.0
-
How did you install
nvm
? (e.g. install script in readme, Homebrew): -
What steps did you perform? What happened?
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
which worked great.
Then I ran nvm install lts/dubnium
resulting in
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12819 100 12819 0 0 1347 0 0:00:09 0:00:09 --:--:-- 2268
=> Downloading nvm from git to '/home/naturgewalt/.nvm'
=> Cloning into '/home/naturgewalt/.nvm'...
remote: Enumerating objects: 267, done.
remote: Counting objects: 100% (267/267), done.
remote: Compressing objects: 100% (242/242), done.
remote: Total 267 (delta 31), reused 86 (delta 15), pack-reused 0
Receiving objects: 100% (267/267), 119.47 KiB | 26.00 KiB/s, done.
Resolving deltas: 100% (31/31), done.
=> Compressing and cleaning up git repository
=> nvm source string already in /home/naturgewalt/.zshrc
=> bash_completion source string already in /home/naturgewalt/.zshrc
npm ERR! missing: semver@~5.3.0, required by node-gyp@3.8.0
=> You currently have modules installed globally with `npm`. These will no
=> longer be linked to the active version of Node when you install a new node
=> with `nvm`; and they may (depending on how you construct your `$PATH`)
=> override the binaries of modules installed with `nvm`:
/usr/lib
├── atom-package-manager@2.1.3
├── emojione@4.0.0
└── yarn@1.12.3
=> If you wish to uninstall them at a later point (or re-install them under your
=> `nvm` Nodes), you can remove them from the system Node as follows:
$ nvm use system
$ npm uninstall -g a_module
=> Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
which installed the v10.15.0
, but gave the error
nvm is not compatible with the npm config "prefix" option: currently set to ""
Run `npm config delete prefix` or `nvm use --delete-prefix v10.15.0` to unset it.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 66 (24 by maintainers)
I figured this out on my system. For other Arch/Manjaro users here’s how you can find the cause:
node
it executes:export PATH="/home/foo/.nvm/versions/node/v10.15.3/bin:$PATH"
node
, have it segfault.coredumpctl gdb -1
. You’ll see information from the core dump. At the very bottom you will likely see a .so file referenced, here’s mine:#0 0x00007fea7b0f114d in v8::FunctionTemplate::New(v8::Isolate*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&), v8::Local<v8::Value>, v8::Local<v8::Signature>, int, v8::ConstructorBehavior) () from /usr/lib/popcorntime/0.3.10/libnw.so
So for me it was Popcorn Time installed from the AUR (popcorntime-bin). After I removed Popcorn Time all versions of node worked.
I tried the following workaround (in
.zshrc
):Which does result in the correct
which node
orwhich npm
, but if I trynode
I getsegmentation fault (core dumped) node
@agaskell Good eye
I’m on arcolinux here and my output definitely points to
libnw.so
, but says nothing about where it is from (i.e. popcorntime), however I did have popcorntime-bin installed. After removing popcorntime, I didn’t even have to close my terminal; but instead rannode
again and it worked!Thank you!
EDIT: I have installed this popcorntime (https://aur.archlinux.org/packages/popcorntime-git/) and it works with NVM. It does take a bit to download, compile and install (about 4 mins for me).
@ljharb tested, same issue with v10.x node branches
just changing the nvm_dir script code on my zshrc fixed it:
i am noticing the same behavior on archlinux. `signal1 fails to build because of this nvm issue at https://aur.archlinux.org/packages/signal/
OK, so, let’s see.
What’s the output of the following?
@dagadbm that’s because nvm doesn’t work if NVM_DIR or HOME are symlinks. See #617.
@DimitrK can you file a separate issue about your OS X problem? There’s a few comments on this issue unrelated to manjaro but it’d be great if you could file something separate (@CrowderSoup figured out their problem, and it was unrelated)
I’m also able to reproduce this issue on my Manjaro Linux running nvm version: 0.34.0. Following versions of node works:
However, nvm fails to switch over to following versions of node:
Considering it’s a best practice to always filter everything through
/usr/bin/env
, i’m not really sure what to do there 😕Okay, so I found a fix on my system. I installed bitwarden-cli with homebrew (osx). That installed node on my system. For whatever reason having the system node broke nvm. I removed the system node/npm and it works just fine now.
nope, it only segfaults if I try to use nvm.
@ljharb one sec, i think v10.13.0 is the one that is affected. v8.9.3 worked fine on my system
PATH=".nvm/versions/node/v8.9.3/bin/" node
would drop me in the replGiven that everyone with this issue is on “manjaro” I still am inclined to believe it’s an issue with node itself, not nvm.