在尝试创建新的vue-cli webpack构建时,我一直收到拒绝权限的throw错误。它昨晚工作,但现在突然间我得到了这些错误。任何人都知道如何解决这个问题?
/usr/local/lib/node_modules/vue-cli/node_modules/rimraf/rimraf.js:312
throw er
^
Error: EACCES: permission denied, unlink
答案 0 :(得分:1)
看起来你在Linux上运行这个命令;尝试使用chown
授予您访问所有这些目录/文件的权限。
答案 1 :(得分:0)
我也遇到这种错误:
downloading template
/usr/local/lib/node_modules/@vue/cli-init/node_modules/rimraf/rimraf.js:313
throw er
^
Error: EACCES: permission denied, unlink '/home/apoorv/.vue-templates/webpack/.gitignore'
at Object.unlinkSync (fs.js:956:3)
at rimrafSync (/usr/local/lib/node_modules/@vue/cli-init/node_modules/rimraf/rimraf.js:306:17)
at /usr/local/lib/node_modules/@vue/cli-init/node_modules/rimraf/rimraf.js:342:5
at Array.forEach (<anonymous>)
at rmkidsSync (/usr/local/lib/node_modules/@vue/cli-init/node_modules/rimraf/rimraf.js:341:26)
at rmdirSync (/usr/local/lib/node_modules/@vue/cli-init/node_modules/rimraf/rimraf.js:334:7)
at rimrafSync (/usr/local/lib/node_modules/@vue/cli-init/node_modules/rimraf/rimraf.js:304:9)
at downloadAndGenerate (/usr/local/lib/node_modules/@vue/cli-init/node_modules/vue-cli/bin/vue-init:149:20)
at checkVersion (/usr/local/lib/node_modules/@vue/cli-init/node_modules/vue-cli/bin/vue-init:130:11)
at Request.request [as _callback] (/usr/local/lib/node_modules/@vue/cli-init/node_modules/vue-cli/lib/check-version.js:29:5)
at Request.self.callback (/usr/local/lib/node_modules/@vue/cli-init/node_modules/request/request.js:185:22)
at Request.emit (events.js:198:13)
at Request.<anonymous> (/usr/local/lib/node_modules/@vue/cli-init/node_modules/request/request.js:1161:10)
at Request.emit (events.js:198:13)
at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/@vue/cli-init/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:286:20)
似乎我没有适当的权限
/home/apoorv/.vue-templates/webpack/.gitignore
在@Nathan Wailes的回答之后,我只是使用以下方法更改了权限并解决了我的问题:
chmod -R 777 /home/apoorv/.vue-templates/*