E:\Program Files>npm install webpack@3.6.0 -g
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! path C:\Users\HP\AppData\Roaming\npm\node_modules\webpack\node_modules\_fsevents@1.2.9@fsevents\node_modules\string-width
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\HP\AppData\Roaming\npm\node_modules\webpack\node_modules\_fsevents@1.2.9@fsevents\node_modules\string-width' -> 'C:\Users\HP\AppData\Roaming\npm\node_modules\webpack\node_modules\yargs\node_modules\cliui\node_modules\string-width'
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\HP\AppData\Roaming\npm-cache\_logs\2020-06-29T02_32_13_692Z-debug.log
最后的解决办法:
删除C:\Users\HP\AppData\Roaming\npm\node_modules\webpack\node_modules这个文件夹,再次npm install webpack@3.6.0 -g
就可以了