文章目录
- 1. 项目build的时候报错Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
- 2. WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
1. 项目build的时候报错Warning: Accessing non-existent property ‘cat’ of module exports inside circular dependency
错误描述
运行 npm run build
building for production...(node:97524) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:97524) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:97524) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
解决方案:
package.json里面的 “shelljs”:版本修改为0.8.4
重新 npm i
然后npm run build
即可
2. WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
问题描述:
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.output.path: The provided value "./" is not an absolute path!
-> The output directory as **absolute path** (required).
解决方案:
确定问题来源,检测Webpack配置文件 webpack.base.conf.js
根据错误信息,我们可以得到一些关于配置文件的提示。可能的错误信息包括缺少必需的属性、属性值的类型错误或不支持的配置选项等等。根据错误信息,逐个检查配置文件并进行调整。