0

am a newbie in meanjs app development so i decided to follow the tutorial at http://www.bradoncode.com/tutorials/mean-stack-tutorial-part-1-setup/

I have installed the necessary tools to get started using the commands below
sudo npm install -g bower
sudo npm install -g grunt-cli
sudo npm install -g yo
sudo npm install -g generator-meanjs

I have created a project directory,but meanjs app installation always fails at a point with the error below using both yo meanjs and sudo yo meanjs commands . I know it has something to do with root permission, PLEASE HELP ME OUT!

Error: Command failed: /bin/sh -c cd mean && npm install.
npm ERR! Linux 3.19.0-30-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.12
npm ERR! path /home/omoniyi289/.npm/mongoose/4.2.5
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/home/omoniyi289/.npm/mongoose/4.2.5'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, mkdir '/home/omoniyi289/.npm/mongoose/4.2.5']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/home/omoniyi289/.npm/mongoose/4.2.5',<br>
npm ERR!   parent: 'mean' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR!     /home/omoniyi289/NorthwindNode/mean/npm-debug.log

at ChildProcess.exithandler (child_process.js:203:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
code_titan
  • 23
  • 4

1 Answers1

1

please check out this link: this link from the official npm documentation. Hope it helps.

Otherwise you could uninstall npm and reinstall with the excellent node version manager(nvm). This alows you to install various versions of node and use whichever at a time. It also allows you to run npm install without the sudo prefix.

npm install -g nvm

update your path to include ./node_modules/.bin

 export PATH=./node_modules/.bin:$PATH

then to install a node version(e.g. 5.0)

nvm install 5.0

then to use version 5.0

nvm use 5.0
Excellence Ilesanmi
  • 3,295
  • 1
  • 18
  • 17
  • Thanks lon!, i followed the first suggestion but still brings same error. The second suggestion says node 5.0 doesn't exit after installing nvm and trying to download it using nvm! – code_titan Nov 12 '15 at 20:06
  • check (https://nodejs.org/en/download/releases/) for node versions. 5.0 is the latest version, but I just used it as an example. I use 0.10.32 – Excellence Ilesanmi Nov 12 '15 at 22:00