当前位置:   article > 正文

validateSchema is not a function(解决)_typeerror: (0 , _schemautils.default) is not a fun

typeerror: (0 , _schemautils.default) is not a function

目录

问题

解决

方法一、安装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

 

如果有疑问,欢迎评论留言或者私信沟通!  

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/286805
推荐阅读
相关标签
  

闽ICP备14008679号