搜索
node.js - centos7 root用户,用npm安装yo,yo是不是不能用?
世界只因有你
世界只因有你 2017-06-29 10:09:28
[Node.js讨论组]

本人在centos下,用root用户安装了node和npm。
然后安装yo,

npm install -g yo



Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✔ npm version
✔ NODE_PATH matches the npm root

Everything looks all right!
+ yo@2.0.0

然而使用yo时,却报错。

[root@localhost address-book]# yo -v
/root/.node/lib/node_modules/yo/node_modules/insight/node_modules/configstore/index.js:53
                                throw err;
                                ^

Error: EACCES: permission denied, open '/root/.config/configstore/insight-yo.json'
You don't have access to this file.

    at Error (native)
    at Object.fs.openSync (fs.js:641:18)
    at Object.fs.readFileSync (fs.js:509:33)
    at Object.get (/root/.node/lib/node_modules/yo/node_modules/insight/node_modules/configstore/index.js:34:26)
    at Object.Configstore.get (/root/.node/lib/node_modules/yo/node_modules/insight/node_modules/configstore/index.js:81:13)
    at Insight.get (/root/.node/lib/node_modules/yo/node_modules/insight/lib/index.js:48:22)
    at Object.<anonymous> (/root/.node/lib/node_modules/yo/lib/cli.js:194:47)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)

google也没有找到答案。。
难道是不能用root用户安装这些?

世界只因有你
世界只因有你

全部回复(3)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板