[Problem solving] Error: Cannot find module'webpack-cli'

Problem statement

When installing the vue project, you need to rely on webpack for project packaging. At this time, you need to install the webpack-cli module. During the installation process, an error message may appear: Error: Cannot find module'webpack-cli', as shown in the figure below
img

solution

Choose global installation when installing webpack-cli with npm

npm install webpack-cli -g

After successful resolution, the following prompt will appear
img

Guess you like

Origin blog.csdn.net/weixin_44704985/article/details/113970204