Problem Description:
When moving a folder item or a copied item, run the error: cannot find module ‘xxx’
Solution:
Delete node_ In the modules folder, delete the package-lock.json file, then NPM install, and then run the project
The following is the complete error message
PS D:\test> npm run dev
> [email protected] dev D:\test
> vite
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'esbuild'
Require stack:
- D:\test\node_modules\[email protected]@vite\dist\node\chunks\dep-85dbaaa7.js
- D:\test\node_modules\[email protected]@vite\dist\node\cli.js
- D:\test\node_modules\[email protected]@vite\bin\vite.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (D:\test\node_modules\[email protected]@vite\dist\node\chunks\dep-85dbaaa7.js:13:15)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'D:\\test\\node_modules\\[email protected]@vite\\dist\\node\\chunks\\dep-85dbaaa7.js',
'D:\\test\\node_modules\\[email protected]@vite\\dist\\node\\cli.js',
'D:\\test\\node_modules\\[email protected]@vite\\bin\\vite.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: `vite`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2021-11-01T02_40_03_715Z-debug.log
Read More:
- Error: Cannot find module’webpack/bin/config-yargs’ solution
- npm run devstart error: Error: Unable to find module ‘semver’
- [Solved] Error: Cannot find module ‘@vue/cli-shared-utils
- Vue project startup error: cannot find module XXX
- [Solved] Error: Cannot find module ‘webpack/lib/RequestShortener’
- Error: Cannot find module ‘process-nextick-args’
- Module build failed: error: cannot find module ‘node sass’ error
- Copy node causes NPM execution error: cannot find module ‘/ / lib / utils/ unsupported.js ‘
- NPM- Cannot find module ‘xxxxx’
- Error: cannot find module ‘mongoose’
- Error reported by nodejs server of CentOS system: solution to cannot find module ‘jQuery’
- When starting Vue project: cannot find module ‘webpack cli/bin/config yargs’ error [How to Fix]
- Gulp Error: Cannot find module ‘jshint/src/cli’;
- VUE Error: Cannot find module ‘webpack/bin/config-yargs’
- Module build failed: Error: ENOENT: no such file or directory, scandir,‘node_modules\node-sass\vend’
- Error: ENOENT: no such file or directory, uv_cwd Error: Cannot find module
- Cannot find module ‘internal / util / types’ appears during gulp build
- The docker copies the win10 host file into the docker container. An error is reported: copying between containers is not supported
- Error: Cannot find module ‘webpack/schemas/WebpackOptions.json’
- Solved – problem cannot find module ‘webpack / bin / config yargs’