无法创建yeoman webapp

Ani*_*esh 4 node.js yeoman yeoman-generator

当我尝试创建一个webapp时,我得到了这个yeoman.

/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:66
                throw err;
                      ^
Error: EACCES, permission denied '/root/.config/configstore/insight-yo.yml'
You don't have access to this file.

    at Object.fs.openSync (fs.js:436:18)
    at Object.fs.writeFileSync (fs.js:975:15)
    at Object.create.all.set (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:56:8)
    at Object.Configstore (/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:19:11)
    at new Insight (/usr/local/lib/node_modules/yo/node_modules/insight/lib/insight.js:23:34)
    at process.<anonymous> (/usr/local/lib/node_modules/yo/node_modules/insight/lib/push.js:11:16)
    at process.emit (events.js:98:17)
    at handleMessage (child_process.js:322:10)
    at Pipe.channel.onread (child_process.js:349:11)
Run Code Online (Sandbox Code Playgroud)

我用谷歌搜索,我尝试了以下的事情,但它没有帮助:

chown root /root/.config/configstore/insight-yo.yml 

chown myusername /root/.config/configstore/insight-yo.yml 
Run Code Online (Sandbox Code Playgroud)

安装npm-sudo-fix并运行它,但没有运气.

我在Debian Wheezy,并且有npm 1.4.4.

小智 11

我面临同样的问题.我运行下面的命令,它解决了我的问题:

mkdir -p /root/.config/configstore

chmod g+rwx /root /root/.config /root/.config/configstore
Run Code Online (Sandbox Code Playgroud)