0
votes

Hello everyone I am running into a problem that I can't seem to get my head around. I am setting up a server to deploy an app. The server is Ubuntu 16.04 LTS (Xenial Xerus) PVHVM. I have installed NVM and have installed all of my npm packages but for some reason I am unable to install yeoman. I have tried various solutions and none seem to work. Any ideas and or suggestions would be greatly appreciated.

When I try to install yeoman with the following I get permission denied

npm install -g yo

Error:

/root/.nvm/versions/node/v8.1.4/bin/yo -> /root/.nvm/versions/node/v8.1.4/lib/node_modules/yo/lib/cli.js /root/.nvm/versions/node/v8.1.4/bin/yo-complete -> /root/.nvm/versions/node/v8.1.4/lib/node_modules/yo/lib/completion/index.js

[email protected] postinstall /root/.nvm/versions/node/v8.1.4/lib/node_modules/yo yodoctor sh: 1: yodoctor: Permission denied npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! [email protected] postinstall: yodoctor npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the [email protected] postinstall script.

Solutions researched/attempted:

npm throws error without sudo

https://github.com/keystonejs/keystone/issues/1566

Install NPM into home directory with distribution nodejs package (Ubuntu)

2
Try with sudo...EvgenyKolyakov
I tried sudo and I get the same errorGalactic Ranger
I think you made a mess... how come that without sudo your home is /root and the error is complaining about permissions... you are not doing this with the user to whom npm belongs..EvgenyKolyakov
What is the output for which npmEvgenyKolyakov
This is my first time using ubunto. I try really hard not to make a mess. Let me explain my steps and you can tell me if I did something wrong. 1) installed ubuntu 2) sudo apt-get update 3) sudo apt-get install build-essential libssl-dev 4) curl -o- raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash 5) Relaunced terminal 6) npm install -g yoGalactic Ranger

2 Answers

0
votes

try uninstall nvm then remove ~/.nvm folder and install it from script

do

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

add that line in ~/.bashrc

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

0
votes

Based on the feedback I received I created a new user, gave that user sudo, installed nvm, installed nvm install stable and was then able to install yeoman without any errors