above

If you’ve been frantically installing or uninstall webPack and it doesn’t work, just delete everything in the box below and reinstall. Of course, if you’re packing a folder with node_modules in it, it’s best to delete it.

npm install -g cnpm --registry=https://registry.npm.taobao.org

cnpm install -g webpack

cnpm install -g webpack-cli

Because the 4.x version separates the CLI, you need to install it separately.

Then enter webpcak -v to view the version number, I here is directly out of the version number, indicating that the installation is successful. Then run vue Init Webpack in the folder you want to pack

cnpm install

CNPM run dev will do the job.

Although I don’t know why there are always such and such errors when using NPM installation, here is a new installation method for you.

I’m eighteen. I hope we can be friends.