webpack-dev-server安装失败
npm ERR! path C:UsersYYTDesktopdot_webpack
ode_modulesexpress
ode_modules
array-flatten
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:UsersYYTDesktop
dot_webpack
ode_modulesexpress
ode_modulesarray-flatten'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
解决办法:
1.安装缺失的模块
2.删除 no such file or directory, access指定路径中的node_modules,再重新安装
3.如果是本地安装,删除全部依赖,重新安装出问题的模块,然后npm install安装其他依赖模块
通过package.json的scripts运行webpack-dev-server时报错
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
解决办法:
1.建议webpack-dev-server版本换成2.8.2或更高版本(测试可用)
2.运行提示命令,本地安装webpack-cli
通过package.json的scripts运行webpack-dev-server时报错
throw new Error('invalid "instanceof" keyword value ' + c)
解决办法:
webpack-dev-server版本指定为2.8.2或更高版本(测试可用)
解决办法(不建议):
本地依赖webpack-cli降到2.x版本
本地依赖webpack-dev-server降到2.x版本
(测试:webpack@3.6.0,webpack-cli@2.1.5,webpack-dev-serer@3.1.4可用)