mpvue——Error: EPERM: operation not permitted

报错

$ npm run build

> mpvue@1.0.0 build D:\wamp\www\webpack\mpvue\my-project
> node build/build.js wx

D:\wamp\www\webpack\mpvue\my-project\build\build.js:19
  if (err) throw err
           ^

Error: EPERM: operation not permitted, unlink 'D:\wamp\www\webpack\mpvue\my-project\dist\wx\components'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mpvue@1.0.0 build: `node build/build.js wx`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mpvue@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator.KING\AppData\Roaming\npm-cache\_logs\2019-03-04T01_42_19_971Z-debug.log

 

解决

管理员身份运行cmd

mpvue——Error: EPERM: operation not permitted_第1张图片

 

目录权限

把所有的目录权限全给了

mpvue——Error: EPERM: operation not permitted_第2张图片

 

关机重启

修改目录权限后,以管理员身份运行cmd,再次执行npm run build 无效,重启再次执行后可以了。不知道windows是怎么了。

 

转载于:https://www.cnblogs.com/wangyang0210/p/10469112.html

你可能感兴趣的:(mpvue——Error: EPERM: operation not permitted)