由于漏洞,我刚刚更新了package.json中的某些软件包。所有漏洞都已修复,但是当我执行npm运行时出现以下错误。 我的漏洞修复过程中复制插件程序包已更新。
我尝试从较早的提交中复制package.json并重新安装所有软件包,但随后该漏洞再次出现。
ValidationError: Invalid options object. Copy Plugin has been initialized using an options object that does not match the API schema.
- options[0] misses the property 'patterns'. Should be:
[non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
- options[1] misses the property 'patterns'. Should be:
[non-empty string | object { from, to?, context?, globOptions?, toType?, force?, flatten?, transform?, cacheTransform?, transformPath?, noErrorOnMissing? }, ...] (should not have fewer than 1 item)
答案 0 :(得分:1)
有关配置问题:
仅在webpack.common.js中适应以下部分 :
module.exports = {
plugins: [
new CopyWebpackPlugin({
patterns: [
{ from: Path.resolve('./modules/web/static/'), to: './assets' },
{ from: Path.resolve('./modules/web/static/favicon.ico'), to: './' },
]
}),
new TsChecker({ typescript: { configFile: Path.resolve('tsconfig.json') } }),
答案 1 :(得分:1)