我是 meanjs 应用程序开发的新手,所以我决定遵循http://www.bradoncode.com/tutorials/mean-stack-tutorial-part-1-setup/上的教程
我已经安装了必要的工具来开始使用下面的命令
sudo npm install -g bower
sudo npm install -g grunt-cli
sudo npm install -g yo
sudo npm install -g generator-meanjs
我已经创建了一个项目目录,但是使用yo meanjs和 sudo yo meanjs命令时,meanjs 应用程序安装总是失败并出现以下错误 。我知道这与root权限有关,请帮助我!
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)