我是Ubuntu和Angular的新手。我正在尝试建立一个Yeoman框架。但是,每次我运行"哟"命令。发生以下错误:
Error: EACCES, mkdir '/home/diarmuid/tmp/npm-2997-20XPEB7W'
npm ERR! { [Error: EACCES, mkdir '/home/diarmuid/tmp/npm-2997-20XPEB7W']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/diarmuid/tmp/npm-2997-20XPEB7W',
npm ERR! parent: 'davidmoshertutorial' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.8.0-35-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/diarmuid/AngularTutorial/DavidMosherTutorial
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! path /home/diarmuid/tmp/npm-2997-20XPEB7W
npm ERR! code EACCES
npm ERR! errno 3
有谁知道如何解决这个问题?我试图运行" sudo yo"但是我得到了回应:
change to change where npm stores global packages by
putting ~/npm/bin in your PATH and running:
npm config set prefix ~/npm
我跑到gedit~ / .profile并将文件编辑为:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH:/~/npm/bin"
fi
我显然有点失落。如果有人有任何建议,将不胜感激。
答案 0 :(得分:11)
运行此命令:
sudo chown -R `whoami` ~/tmp
主目录中的tmp
文件夹应由用户拥有,而不是由管理员拥有。