赞
踩
目录
使用webpack命令打包的时候报错,运行命令:
webpack ./
报错:
validateSchema is not a function
npm install webpack -g
可以使用如下命令,查看是否安装成功。
webpack -v
1. 卸载之前的版本,命令:
npm uninstall webpack
运行结果:
- npm WARN babel-loader@8.1.0 requires a peer of webpack@>=2 but none is installed. You must install peer dependencies yourself.
- npm WARN expose-loader@0.7.5 requires a peer of webpack@^2.0.0 || ^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
- npm WARN webpack-cli@3.3.11 requires a peer of webpack@4.x.x but none is installed. You must install peer dependencies yourself.
-
- audited 1253 packages in 9.442s
-
- 28 packages are looking for funding
- run `npm fund` for details
-
- found 318 vulnerabilities (301 low, 7 moderate, 10 high)
- run `npm audit fix` to fix them, or `npm audit` for details
2. 安装指定版本,命令:
npm install webpack@3.10.0 -g
执行结果:
- npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
- /usr/local/bin/webpack -> /usr/local/lib/node_modules/webpack/bin/webpack.js
-
- > uglifyjs-webpack-plugin@0.4.6 postinstall /usr/local/lib/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
- > node lib/post_install.js
-
- npm WARN notsup Unsupported engine for watchpack-chokidar2@2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"8.11.3","npm":"6.14.7"})
- npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2@2.0.0
- npm WARN notsup Unsupported engine for fsevents@2.1.3: wanted: {"node":"^8.16.0 || ^10.6.0 || >=11.0.0"} (current: {"node":"8.11.3","npm":"6.14.7"})
- npm WARN notsup Not compatible with your version of node/npm: fsevents@2.1.3
-
- + webpack@3.10.0
- added 112 packages from 124 contributors, removed 93 packages, updated 24 packages and moved 4 packages in 46.777s
如果有疑问,欢迎评论留言或者私信沟通!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。