我安装webpack时,出现如下错误:
C:Usersadmin> npm install webpack -g
npm WARN checkPermissions Missing write access to C:UsersadminAppDataRoaming
pm
ode_moduleswebpack
ode_modulesfsevents
npm ERR! path C:UsersadminAppDataRoaming
pm
ode_moduleswebpack
ode_modulesfsevents
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:UsersadminAppDataRoaming
pm
ode_moduleswebpack
ode_modulesfsevents'
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:UsersadminAppDataRoaming
pm-cache\_logs2019-03-16T03_59_56_513Z-debug.log
解决方法:删除这个路径下的文件C:UsersadminAppDataRoaming pm ode_moduleswebpack ode_modules
可以解决,之前遇到这个问题头痛一个上午,索性删了,重装,最后解决了问题,希望有同样问题的码友走更少的弯路。