Vue3 ERROR Error: Cannot find module 'vue-loader-v16/package.json'
Vue3 npm run serve错误
1)主要错误信息
ERROR Error: Cannot find module 'vue-loader-v16/package.json'
2)Vue3项目 运行环境:
windows10
node -v v16.6.1
vue -V @vue/cli 4.5.13
3)Vue3项目运行操作
3-1 运行指令:
npm run serve
3-2 错误如下:
PS E:\codeVue\echats-vuethreew> npm run serve
> echats-vuethreew@0.1.0 serve E:\codeVue\echats-vuethreew
> vue-cli-service serve
INFO Starting development server...
ERROR Error: Cannot find module 'vue-loader-v16/package.json'
Require stack:
- E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\lib\config\base.js
- E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\lib\Service.js
- E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\bin\vue-cli-service.js
Error: Cannot find module 'vue-loader-v16/package.json'
Require stack:
- E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\lib\config\base.js
- E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\lib\Service.js
- E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\bin\vue-cli-service.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\lib\config\base.js:114:23
at E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\lib\Service.js:236:40
at Array.forEach (<anonymous>)
at Service.resolveChainableWebpackConfig (E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\lib\Service.js:236:26)
at Service.resolveWebpackConfig (E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\lib\Service.js:240:48)
at PluginAPI.resolveWebpackConfig (E:\codeVue\echats-vuethreew\node_modules\@vue\cli-service\lib\PluginAPI.js:132:25)
npm ERR! code ELIFECYCLE
npm ERR! echats-vuethreew@0.1.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the echats-vuethreew@0.1.0 serve 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\ShiXiong\AppData\Roaming\npm-cache\_logs\2021-09-07T15_30_49_878Z-debug.log
PS E:\codeVue\echats-vuethreew> cnpm i vue-loader-v16
√ Installed 1 packages
√ Linked 84 latest versions
√ Run 0 scripts
peerDependencies link acorn@8.5.0 in E:\codeVue\echats-vuethreew\node_modules\_acorn-import-assertions@1.7.6@acorn-import-assertions unmet with E:\codeVue\echats-vuethreew\node_modules\acorn(6.4.2)
peerDependencies link webpack@5.52.0 in E:\codeVue\echats-vuethreew\node_modules\_terser-webpack-plugin@5.2.3@terser-webpack-plugin unmet with E:\codeVue\echats-vuethreew\node_reew\node_modules\.recently_updates.txt)
Today:
→ vue-loader-v16@16.0.0-beta.5.4 ? @types/mini-css-extract-plugin@0.9.1 ? @types/webpack@5.28.0 ? @types/node@*(16.7.13) (15:34:59)
→ vue-loader-v16@16.0.0-beta.5.4 ? @types/mini-css-extract-plugin@0.9.1 ? @types/webpack@5.28.0 ? webpack@5.52.0 ? browserslist@4.17.0 ? electron-to-chromium@^1.3.830(1.3.831) (22:02:29)
√ All packages installed (88 packages installed from npm registry, used 3s(network 3s),
speed 1.09MB/s, json 85(527.36kB), tarball 2.9MB)
3-3 解决方法
执行以下指令
cnpm i vue-loader-v16
PS E:\codeVue\echats-vuethreew> cnpm i vue-loader-v16
√ Installed 1 packages
√ Linked 84 latest versions
√ Run 0 scripts
peerDependencies link acorn@8.5.0 in E:\codeVue\echats-vuethreew\node_modules\_acorn-import-assertions@1.7.6@acorn-import-assertions unmet with E:\codeVue\echats-vuethreew\node_modules\acorn(6.4.2)
peerDependencies link webpack@5.52.0 in E:\codeVue\echats-vuethreew\node_modules\_terser-webpack-plugin@5.2.3@terser-webpack-plugin unmet with E:\codeVue\echats-vuethreew\node_reew\node_modules\.recently_updates.txt)
Today:
→ vue-loader-v16@16.0.0-beta.5.4 ? @types/mini-css-extract-plugin@0.9.1 ? @types/webpack@5.28.0 ? @types/node@*(16.7.13) (15:34:59)
→ vue-loader-v16@16.0.0-beta.5.4 ? @types/mini-css-extract-plugin@0.9.1 ? @types/webpack@5.28.0 ? webpack@5.52.0 ? browserslist@4.17.0 ? electron-to-chromium@^1.3.830(1.3.831) (22:02:29)
√ All packages installed (88 packages installed from npm registry, used 3s(network 3s),
speed 1.09MB/s, json 85(527.36kB), tarball 2.9MB)
3-4 解决后重新运行项目
npm run serve
PS E:\codeVue\echats-vuethreew> npm run serve
> echats-vuethreew@0.1.0 serve E:\codeVue\echats-vuethreew
> vue-cli-service serve
INFO Starting development server...
40% building 109/123 modules 14 active ...k-dev-server\node_modules\ansi-regex\index.js[@vue/compiler-sfc] compileTemplate now requires the `id` option.`.
98% after emitting CopyPlugin
DONE Compiled successfully in 2066ms 下午11:32:09
App running at:
- Local: http://localhost:8080/
- Network: http://192.168.19.106:8080/
|