我安裝webpack時,出現如下錯誤: C:\Users\admin> npm install webpack -gnpm WARN checkPermissions Missing write access to C:\Users\admin\AppData\Roaming\npm\node_mo ...
我安裝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
可以解決,之前遇到這個問題頭痛一個上午,索性刪了,重裝,最後解決了問題,希望有同樣問題的碼友走更少的彎路。