我以超級用戶身份工作,並試圖更改此文件的權限,以便我可以讀取,寫入和執行,但每次運行'yo hubot'時都會改回。文件執行權限在Linux中不斷變回
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------)
[[email protected] 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
然後我運行 「喲」 命令,它拋出一個錯誤EACCES
[[email protected] configstore]# 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: 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/.nvm/versions/node/v6.11.0/lib/node_modules/yo/node_modules/insight/node_modules/configstore/index.js:34:26) at Object.Configstore.get (/root/.nvm/versions/node/v6.11.0/lib/node_modules/yo/node_modules/insight/node_modules/configstore/index.js:81:13) at Insight.get (/root/.nvm/versions/node/v6.11.0/lib/node_modules/yo/node_modules/insight/lib/index.js:48:22) at Object. (/root/.nvm/versions/node/v6.11.0/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)`
我再次檢查該文件,並注意它變回
[[email protected] 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`
我提高了你的問題,因爲它是可能的,懇求寫入錯誤使用qoutes「>」在錯誤的開始標誌。 –
@AliMajedHA謝謝 – Iruoma