validateSchema is not a function(解决)
【摘要】 目录
问题
解决
方法一、安装webpack
方法二、指定webpack版本
问题
使用webpack命令打包的时候报错,运行命令:
webpack ./
报错:
validateSchema is not a function
解决
方法一、安装webpack
npm install webpack -g
可以使用如...
目录
问题
使用webpack命令打包的时候报错,运行命令:
webpack ./
报错:
validateSchema is not a function
解决
方法一、安装webpack
npm install webpack -g
可以使用如下命令,查看是否安装成功。
webpack -v
方法二、指定webpack版本
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
如果有疑问,欢迎评论留言或者私信沟通!
文章来源: liuzhen.blog.csdn.net,作者:Data-Mining,版权归原作者所有,如需转载,请联系作者。
原文链接:liuzhen.blog.csdn.net/article/details/108325045
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)