Node.js 文件执行权限在Linux中不断更改

Node.js 文件执行权限在Linux中不断更改,node.js,linux,centos7,hubot,yo,Node.js,Linux,Centos7,Hubot,Yo,我以root用户身份工作,我试图更改此文件的权限,以便可以读取、写入和执行,但每次运行“yo hubot”时,它都会更改回来 chmod -v u=rwx /root/.config/configstore/insight-yo.json mode of â/root/.config/configstore/insight-yo.jsonâ changed from 0400 (r---- ----) to 0700 (rwx------) [root@me configstore]# ll t

我以root用户身份工作,我试图更改此文件的权限,以便可以读取、写入和执行,但每次运行“yo hubot”时,它都会更改回来

chmod -v u=rwx /root/.config/configstore/insight-yo.json
mode of â/root/.config/configstore/insight-yo.jsonâ changed from 0400 (r----
----) to 0700 (rwx------)
[root@me configstore]# ll
total 8
权限在此更改

-rwx------. 1 root root 30 Jul 24 21:38 insight-yo.json
-rwxr-xr-x. 1 root root 55 Jul 24 21:24 update-notifier-npm.json
然后我运行“yo”命令,它抛出一个EACCES错误

[root@meconfigstore]#yo hubot root/.nvm/versions/node/v6.11.0/lib/node_modules/yo/node_modules/insight/node_modules/configstore/index.js:53 root/.nvm/versions/node/v6.11.0/lib/node_modules/yo/node_modules/insight/node_modules/configstore/index.js:53

错误:

EACCES:权限被拒绝,打开“/root/.config/configstore/insight”- yo.json':您没有访问此文件的权限

(/root/.nvm/versions/node/v6.11.0/lib/node_modules/yo/node_modules/insight/node_modules/configstore/index.js:34:26) 在Object.Configstore.get(/root/.nvm/versions/node/v6.11.0/lib/node_modules/yo/node_modules/insight/node_modules/Configstore/index.js:81:13) 在Insight.get(/root/.nvm/versions/node/v6.11.0/lib/node_modules/yo/node_modules/Insight/lib/index.js:48:22) 反对。(/root/.nvm/versions/node/v6.11.0/lib/node_modules/yo/lib/cli.js:194:47)

我再次检查该文件,发现它又变了回来

[root@me configstore]# ll
total 8
-rw-------. 1 root root 30 Jul 24 21:45 insight-yo.json
-rwxr-xr-x. 1 root root 55 Jul 24 21:24 update-notifier-npm.json`

我发现问题出在'yo'上,而不是文件本身,而且'yo'显然不能作为'root'运行,所以以另一个用户的身份运行'yo',它运行时没有任何错误


谢谢

我尽可能地改进了您的问题,请在错误开始处用“>”符号在qoutes中写下错误。@AliMajedHA谢谢您
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)`
[root@me configstore]# ll
total 8
-rw-------. 1 root root 30 Jul 24 21:45 insight-yo.json
-rwxr-xr-x. 1 root root 55 Jul 24 21:24 update-notifier-npm.json`