问答详情
源自:2-2 Yeoman, Bower, Grunt简介及安装

中途还是需要sudo怎么办呢?

我用命令sudo yo webapp webapp-by-yo运行,可是安装了一半后,还是会报错,提示【npm ERR! Please try running this command again as root/Administrator.】是不是说在程序自动下载或者创建目录的时候也需要sudo   那我到底该怎么处理呢?

npm ERR! Error: EACCES, mkdir '/Users/sunjunjie/.npm/fs-extra/0.16.3'

npm ERR!  { [Error: EACCES, mkdir '/Users/sunjunjie/.npm/fs-extra/0.16.3']

npm ERR!   errno: 3,

npm ERR!   code: 'EACCES',

npm ERR!   path: '/Users/sunjunjie/.npm/fs-extra/0.16.3',

npm ERR!   parent: 'phantomjs' }

npm ERR! 

npm ERR! Please try running this command again as root/Administrator.


提问者:右位心 2015-01-31 12:53

个回答

  • Materliu
    2015-02-02 10:45:59

    为当前账户添加node_modules目录读写权限即可。

    sudo chown -R $(whoami) ~/.npm