Cannot find module 'webpack/lib/node/NodeTemplatePlugin”问题

来源:互联网 发布:洛阳中国联合网络通信 编辑:程序博客网 时间:2024/05/29 18:14
up vote
down voteaccepted

Node requires you to install webpack to your project.

You have 2 options to solve the above:

  1. Remove global webpack and install it locally

    npm uninstall -g webpack npm install --save-dev html-webpack-plugin webpack webpack-dev-server

  2. You can link the global webpack pkg to your project's node modules. The downside of this is that your project will be forced to use most updated webpack. This will create a problem only when some updates are not backwards compatible.

    npm i webpack -g; npm link webpack --save-dev

You can omit the html-webpack-plugin depending on your requirement.

You can find more info here: https://github.com/webpack/webpack/issues/2131

我选择的是第二种

阅读全文
0 0
原创粉丝点击