webpack提示Cannot read property ‘properties’ of undefined错误

该文章发布于 ,归类于 Webpack 0 条评论

提示这样一堆错误

/Users/xxx/Code/js/xxx/node_modules/_webpack-cli@2.1.5@webpack-cli/bin/config-yargs.js:89
                describe: optionsSchema.definitions.output.properties.path.description,
                                                           ^

TypeError: Cannot read property 'properties' of undefined
    at module.exports (/Users/xxx/Code/js/xxx/node_modules/_webpack-cli@2.1.5@webpack-cli/bin/config-yargs.js:89:48)
    at Object.<anonymous> (/Users/xxx/Code/js/xxx/node_modules/_webpack-dev-server@3.1.9@webpack-dev-server/bin/webpack-dev-server.js:84:40)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)

出现这个错误是因为webpack-cli版本的问题,升级到3.1.1版本或更新即可。

npm i webpack-cli@3.1.1 -D

再运行就没有问题了。

相关文章