-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
oh-my-zsh: NVM is not compatible with the npm config "prefix" option #855
Comments
Thanks for the report! What does |
Could not find /Users/Fabian/.nvm/*/bin in $PATH
Could not find /Users/Fabian/.nvm/*/share/man in $MANPATH
$SHELL: /bin/zsh
$NVM_DIR: /Users/Fabian/.nvm
nvm current: none
which node: node not found
which iojs: iojs not found
which npm: npm not found
npm config get prefix: nvm:74: command not found: npm
npm root -g: nvm:74: command not found: npm |
and the env vars? |
PATH=.:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/local/heroku/bin:/usr/local/mysql/bin:/usr/local/git/bin:/usr/local/mongodb/bin:/usr/bin:/usr/sbin:/usr/local/lib/AIRSDK:/usr/local/lib/AIRSDK/bin:/Users/fabian:/Users/fabian/bin:/Users/fabian/.bin:/Users/fabian/.phpdoc/bin:/Users/fabian/pear/bin:/Users/fabian/.composer/vendor/bin:/Users/fabian/android.ndk:/Users/fabian/android.sdk/r24.3.4:/Users/fabian/android.sdk/r24.3.4/tools:/Volumes/Hyper/Development/Go/bin:/Library/Java/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
TMPDIR=/var/folders/mp/hd4fy3n15z17_g9s4j11y8gm0000gn/T/
LOGNAME=fabian
XPC_FLAGS=0x0
HOME=/Users/fabian
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.WrQOEzC6ut/Render
TERM=xterm-256color
COLORFGBG=7;0
USER=fabian
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.FEGVlgCDcM/Listeners
ITERM_PROFILE=Default
TERM_PROGRAM=iTerm.app
XPC_SERVICE_NAME=0
SHELL=/bin/zsh
ITERM_SESSION_ID=w0t0p0
PWD=/Users/fabian
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
LC_CTYPE=UTF-8
SHLVL=1
OLDPWD=/Users/fabian
ZSH=/Users/fabian/.oh-my-zsh
LANG=en_US.UTF-8
GOPATH=/Volumes/Hyper/Development/Go
NODE_PATH=/usr/local/bin/node
NODE_HOME=/usr/local/lib/node
JAVA_HOME=/Library/Java/Home
ANDROID_SDK=/Users/fabian/android.sdk/r24.3.4
ANDROID_NDK=/Users/fabian/android.ndk
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:
NVM_DIR=/Users/Fabian/.nvm
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist
NVM_IOJS_ORG_MIRROR=https://iojs.org/dist
MANPATH=/usr/share/man:/usr/local/share/man:/usr/local/mysql/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man
NVM_PATH=/Users/Fabian/.nvm/versions/node/v0.12.7/lib/node
NVM_BIN=/Users/Fabian/.nvm/versions/node/v0.12.7/bin
_=/usr/bin/printenv |
Thanks! so, clearly you don't have an npm prefix set. Are you by chance using |
Yeah, I am.. I could manually set it, I assume? How do I go about that? |
If you try to set the "prefix" that will break As a temporary workaround, you can do |
Okay, let me know if I can help with anything! |
Could you provide the output of |
alwaystoend
autocd
autopushd
cdablevars
completeinword
extendedhistory
noflowcontrol
histexpiredupsfirst
histignoredups
histignorespace
histverify
incappendhistory
interactive
interactivecomments
login
longlistjobs
nonomatch
promptsubst
pushdignoredups
pushdminus
sharehistory
shinstdin |
Thanks! I'll take a look at this asap. |
One more thing that could be interesting: this is a brand new installation of El Capitan; I didn't have this issue before on Mavericks (I also used oh my zsh on Mavericks) |
Good to know - I don't have an El Capitan machine to test on just yet. |
If you have anything else I should test for you, just let me know. |
I definitely started noticing these issues after upgrading to El Capitan. |
@mikepaggi you're also on |
I'm also getting this issue on Yosemite:
Once I run |
@rudeworks |
I get the same error on Yosemite: |
@ckiss thanks - also on |
FWIW I'm also getting this on Arch Linux also with I hadn't updated nvm in a while, but I did just notice that the last 'good' tag (i.e. no error shown) was v0.26.1. I'll see if I can find the actual commit where this begins. |
Thanks - I'm quite certain it's simply the commit where I added this check, which suggests that the check doesn't work properly in |
Hi,
|
I have the same problem. and resolved as follows.
(Where 'Falsy' is the my computer username.) |
@falsy assuming |
@ljharb that's right. this is not an exact solution. i have two macOS computers. this problem only occurs on one of them. the difference between the two computers is that the computer in question is logged in as a newly added user instead of an existing admin user. |
Upgrading to the latest version of See https://github.com/nvm-sh/nvm for instructions. |
@fabdrol have you solved your issue, or is it still a problem? |
I am having the same issue on an Amazon Linux 2 cloud machine. I am also using |
Lots of people above have provided solutions to this including reinstall node, uninstall brew node, reinstall nvm etc. But really the only essential step you need to do is to remove the wrong npm reference applied before your nvm script path settings. Most of the time this is Which means you just need to do If this doesn't solve the problem, you can run |
Updating fixed this issue for me as well. |
Hello, |
I met this issue as well, and resolved it by added the following lines to 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
export PATH=$HOME/.nvm/versions/node/v12.16.3/bin:$PATH
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm on FreeBSD, where Disallowing symlinks within one's home path thus doesn't seem to be a very portable way of looking at things. Maybe stuff like |
@ljharb For more info, I've just installed a few recent BSDs in VMs: All the following FreeBSD installations set
The following BSDs don't seem to use symlinks in home paths though:
|
@ljharb Btw, if it's coming in handy for you I can start working on a PR regarding this issue (i.e. supporting OSes that do use symlinks in home paths). Moreover, this is probably a new distinct issue, as it is not related to zsh. UPDATE: I understand there is already a PR going into this direction in #2143 . Let's see if your request for finishing that PR actually triggers a response ;-) . If not I'll maybe look into it. |
@olivermg it would also be awesome if you wanted to just comment on #2143 with a link to your own branch that builds off of it - i can easily pull in those commits, even if the OP doesn't respond. I'd love to improve the workflow here, just because nvm hasn't worked with symlinks for awhile doesn't mean it doesn't suck that it doesn't :-) |
Btw, just noticed that Fedora Silverblue also uses symlinks in home paths:
UPDATE: However, it doesn't seem to be triggering the |
Cannot change root .npmrc as it is locked for change. |
@AnshulSurana that's not the root npmrc, that's your user npmrc, and you should always have full control of anything in |
I do not use oh-my-zsh, I use ZimFW, but I'll still tag along because I think it's related. My flavor of this is pretty damn weird. When I open a terminal, I get: grep: Desktop: Is a directory
grep: Downloads: Is a directory
...etc This also happens on TTY, with no graphical server running at all. In specific directories, I get weird stuff, like: grep: node_modules: Is a directory
grep: out: Is a directory
grep: src: Is a directory
grep: static: Is a directory
(eval):1: command not found: forge.config.js
nvm is not compatible with the "README.md:- [`forge.config.js`](./forge.config.js): decides which packages are used by Electron Forge. In particular, it sets the exporters (Windows, Mac, Linux, ...)" environment variable: currently set to ".md:- [](./forge.config.js): decides which packages are used by Electron Forge. In particular, it sets the exporters (Windows, Mac, Linux, ...)"
Run `unset README.md:- [\`forge.config.js\`](./forge.config.js): decides which packages are used by Electron Forge. In particular, it sets the exporters (Windows, Mac, Linux, ...)` to unset it. Of course, the sentence
is part of my The string > grep -R "forge.config.js" --exclude-dir node_modules
package.json: "forge": "./forge.config.js"
README.md:- [`forge.config.js`](./forge.config.js): decides which packages are used by Electron Forge. In particular, it sets the exporters (Windows, Mac, Linux, ...) If I remove that sentence from the README, then nvm tells me this: nvm is not compatible with the "package.json: "forge": "./forge.config.js"" environment variable: currently set to ".json: forge: ./forge.config.js" If I remove that, then I only get the directories issues described above. Removing only the line in So nvm is deciding on its own to... parse the README.md, extract that string for some reason, then eval it? Then decide that there's an environment variable equal to the whole line? Notice the environment variable's name starts with I can confirm these issues come from nvm, because if I do not source Apart for these annoying notices, nvm is working as expected, as far as I can tell. |
This turned out to be the fix for me. Uninstalled
|
Very annoying issue; every time I want to use node or NPM, I get this error and need to run a command to solve it.
The text was updated successfully, but these errors were encountered: