Bash: /home/ubuntu/.nvm/versions/node/v8.2.1/bin/npm: No such file or directory

npm
#1

Hi,

I receive this error everytime I try to run npm:

~/workspace (master) $ npm -v
bash: /home/ubuntu/.nvm/versions/node/v8.2.1/bin/npm: No such file or directory

~/workspace (master) $ npm run dev
bash: /home/ubuntu/.nvm/versions/node/v8.2.1/bin/npm: No such file or directory

~/workspace (master) $ nvm debug
nvm --version: v0.31.0
$SHELL: /bin/bash
$HOME: /home/ubuntu
$NVM_DIR: ‘$HOME/.nvm’
$PREFIX: ‘’
$NPM_CONFIG_PREFIX: ''
nvm current: v8.2.1
which node: $NVM_DIR/versions/node/v8.2.1/bin/node
which iojs:
which npm: /mnt/shared/sbin/npm
npm config get prefix: bash: $NVM_DIR/versions/node/v8.2.1/bin/npm: No such file or directory
npm root -g: bash: $NVM_DIR/versions/node/v8.2.1/bin/npm: No such file or directory

Does anyone know what is causing this error and how can I fix it?

Regards,

Kenneth

0 Likes

#3

Looks like you might have tinkered with something that wasn’t supposed to be tinkered with :wink: There are a couple instances of people doing this. Take a look at one of these and see if you can find a silver bullet for your instance of the issue:

0 Likes

#4

This happened to me whilst I was removing NVM and installing a node LTS version. First I had to remove the export path to nvm 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
then remove nvm rm -rf ~/.nvm
install node via their macOs installer - you can curl
then update my bash_profile… source ~/.bash_profile
this alias in your bash_profile is really useful alias r='source ~/.bash_profile'

0 Likes