I installed node and npm as root user under centos.
Then install 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
However, when using yo, an error is reported.
[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 didn't find the answer either. .
Isn’t it possible to install these with the root user?
You don't have access to this file.
It seems you don't have access to this file
Look at this file permissions.
Try to reinstall using the following command:
I am running Ubuntu and have the same error as the original poster. Someone, please give me the answer. The method of changing access permissions does not work.
See GitHub Issue:
https://github.com/yeoman/yo/...
A feasible method is mentioned here: use NVM processing.
In addition, it is not recommended to use the root user to install the
npm
package. Various unpredictable problems often occur because you are theroot
user.