Tag Archives: cannot find module XXX error

How to Solve Error: Cannot find module ‘webpack/lib/RequestShortener’

Farewell:

Error: Cannot find module’webpack/lib/RequestShortener’

This is really clueless. Later, there was an article to solve other similar error reporting methods, and I borrowed it, and it really worked!

  1. npm install webpack –save-dev // After the installation is successful, there will be a prompt to install webpack-cli again
  2. npm install webpack-cli –save-dev

After that, it’s okay~

The vue3 project Error: Cannot find module’vue-loader-v16/package.json’

In the past two days, I plan to learn vue3. The build project does not use vite, but builds it through vue cli. The vue cli building vue3 project is similar to the previous vue2, but vue cli needs to be upgraded to the latest version.

After the newly generated project, run an error:

Error: Cannot find module'vue-loader-v16/package.json'

Here is the tutorial on how to solve this problem here:

 

1. Upgrade npm

npm i -g npm

Those who use cnpm should also upgrade cnpm

cnpm i -g cnpm

 

2. Reinstall the node_modules dependency package

rm- rf node_modules // delete the original dependency package first

cnpm i // reinstall

 

3. Re-download

cnpm i -D vue-loader-v16

 

Then you can successfully run the project. . .

When starting Vue project: cannot find module ‘webpack cli / bin / config yargs’ error resolution

An error is reported when starting Vue project: cannot find module ‘webpack cli/bin/config yargs’, as shown in the following figure:

the reason for this error is that the version of webpack and webpack dev server is incompatible. The solution is as follows:

Under this vue project, type:
npm uninstall webpack -g
npm uninstall -g webpack-dev-server
Uninstall and reinstall:
npm install [email protected] --save-dev
npm install [email protected] --save-dev

Restart the project, success!

When starting Vue project: cannot find module ‘webpack cli/bin/config yargs’ error resolution

An error is reported when starting Vue project: cannot find module ‘webpack cli/bin/config yargs’, as shown in the following figure:

the reason for this error is that the version of webpack and webpack dev server is incompatible. The solution is as follows:

input below the VUE project:
npm uninstall  webpack -g
npm uninstall -g webpack-dev-server
uninstall and install:
npm install [email protected] --save-dev
npm install [email protected] --save-dev

Restart the project, success!