我安装webpack时,出现如下错误:
C:\Users\admin> npm install webpack -g
npm WARN checkPermissions Missing write access to C:\Users\admin\AppData\Roaming\npm\node_modules\webpack\node_modules\fsevents
npm ERR! path C:\Users\admin\AppData\Roaming\npm\node_modules\webpack\node_modules\fsevents
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:\Users\admin\AppData\Roaming\npm\node_modules\webpack\node_modules\fsevents'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2019-03-16T03_59_56_513Z-debug.log
解决方法:删除这个路径下的文件C:\Users\admin\AppData\Roaming\npm\node_modules\webpack\node_modules
可以解决,之前遇到这个问题头痛一个上午,索性删了,重装,最后解决了问题,希望有同样问题的码友走更少的弯路。