nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
79.18k stars 7.93k forks source link

NPM Global packages path not in vim #1510

Open jrock2004 opened 7 years ago

jrock2004 commented 7 years ago
nvm --version: v0.32.1
$SHELL: /usr/bin/zsh
$HOME: /home/jcostanzo
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
nvm current: v7.8.0
which node: $NVM_DIR/versions/node/v7.8.0/bin/node
which iojs: iojs not found
which npm: $NVM_DIR/versions/node/v7.8.0/bin/npm
npm config get prefix: $NVM_DIR/versions/node/v7.8.0
npm root -g: $NVM_DIR/versions/node/v7.8.0/lib/node_modules

->       v7.8.0
default -> stable (-> v7.8.0)
node -> stable (-> v7.8.0) (default)
stable -> 7.8 (-> v7.8.0) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> N/A)
lts/argon -> v4.8.2 (-> N/A)
lts/boron -> v6.10.2 (-> N/A)

davidosomething commented 7 years ago

it works for me, in my dotfiles

fyi, you shouldn't have shebang that uses sh in sourced rc files (e.g. #!/bin/sh in your https://github.com/jrock2004/dotfiles/blob/5f72c864cd93a9f3a6f47e17deec0593fba47543/zsh/zplug.zsh) that causes the sh shell to be spawned and commands run in sh instead of the current shell (your zsh instance)

jrock2004 commented 7 years ago

@davidosomething Are you specifying your node modules path in your dotfiles?

davidosomething commented 7 years ago

not manually - NVM does that when it is sourced by zsh (your nvm is sourced by sh)

jrock2004 commented 7 years ago

@davidosomething Is that my issue? Because the way I am sourcing it?

davidosomething commented 7 years ago

that's my guess, you're sourcing a file that -spawns a shell and adds things to that spawned shell- instead of adding things directly into the current shell

jrock2004 commented 7 years ago

@davidosomething I removed that from the file you listed above, so that is not the issue. Guess I will keep looking