我在将 Yeoman 与 Angular 结合使用时遇到问题。它工作正常,直到我使用
grunt serve
为我正在创建的项目启动服务器。
但是,“grunt serve”返回了
Error: Unable to create git_template directory: Arguments to path.resolve must be strings
然后它给了我
Warning: EROFS, read-only file system 'app/index.html' Use --force to continue
然后我用了
grunt serve --force
解决这个问题,然后它击中了我。
我的整个本地文件已变为只读。
我试过“yo doctor”(这是 Yeoman 查找问题的方法),但它甚至不再起作用了。它给了我这个错误:
colin@Studio-XPS-1640:~/Desktop/ang-news$ yo doctor
/usr/local/lib/node_modules/yo/node_modules/insight/node_modules/configstore/configstore.js:66
throw err;
^
Error: EROFS, read-only file system '/home/colin/.config/configstore/insight-yo.yml'
at Object.fs.openSync (fs.js:410:18)
at Object.fs.writeFileSync (fs.js:956: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 Object.<anonymous> (/usr/local/lib/node_modules/yo/cli.js:23:15)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
我尝试使用 chod 和 chown,但无济于事。这是我尝试过的示例
sudo chmod 777 /usr/local/lib/ -R -w
我想我所做的只是弄乱了权限,现在我什至无法再使用 Yeoman,因为所有这些文件都是只读的。
编辑
原来我的整个系统都是只读的。我该如何解决?我试图通过 cmd 提取一些内容,它给了我
“OSError:[Errno 30] 只读文件系统:'/home/colin/startup-001'”
最佳答案
听起来您的系统已将文件系统置于只读模式。在许多情况下都会发生这种情况。您应该检查 dmesg 是否有错误,并可能重新启动并进行文件系统检查。
此外,给公共(public)文件夹(如/usr/local)中的所有用户完全权限可能不是一个好主意。
关于Linux目录卡在只读状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23716469/