您的位置:首页 > Web前端 > Node.js

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

2017-06-30 10:49 656 查看
up
vote
down
voteaccepted
Node requires you to install webpack to your project.

You have 2 options to solve the above:

Remove global webpack and install it locally

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


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

我选择的是第二种

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: