validateSchema is not a function(解决)

举报
liuzhen007 发表于 2021/05/26 16:54:27 2021/05/26
【摘要】 目录 问题 解决 方法一、安装webpack 方法二、指定webpack版本 问题 使用webpack命令打包的时候报错,运行命令: webpack ./ 报错: validateSchema is not a function 解决 方法一、安装webpack npm install webpack -g 可以使用如...

目录

问题

解决

方法一、安装webpack

方法二、指定webpack版本


问题

使用webpack命令打包的时候报错,运行命令:

webpack ./

报错:

validateSchema is not a function

解决

方法一、安装webpack

npm install webpack -g

可以使用如下命令,查看是否安装成功。

webpack -v

方法二、指定webpack版本

1. 卸载之前的版本,命令:

npm uninstall webpack

运行结果:


  
  1. npm WARN babel-loader@8.1.0 requires a peer of webpack@>=2 but none is installed. You must install peer dependencies yourself.
  2. 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.
  3. 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.
  4. audited 1253 packages in 9.442s
  5. 28 packages are looking for funding
  6. run `npm fund` for details
  7. found 318 vulnerabilities (301 low, 7 moderate, 10 high)
  8. run `npm audit fix` to fix them, or `npm audit` for details

2. 安装指定版本,命令:

npm install webpack@3.10.0 -g

执行结果:


  
  1. npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
  2. /usr/local/bin/webpack -> /usr/local/lib/node_modules/webpack/bin/webpack.js
  3. > uglifyjs-webpack-plugin@0.4.6 postinstall /usr/local/lib/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
  4. > node lib/post_install.js
  5. 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"})
  6. npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2@2.0.0
  7. 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"})
  8. npm WARN notsup Not compatible with your version of node/npm: fsevents@2.1.3
  9. + webpack@3.10.0
  10. 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

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。