bug Error: Cannot find module ‘vue-loader-v16/package.json‘的解决办法

更新,命令如下,在

https://stackoverflow.com/questions/63504594/error-cannot-find-module-vue-loader-v16-package-json

查到

cnpm i --save-dev vue-loader-v16
ivyone@ivyonedeMacBook-Pro daily-cost % cnpm install[12/17] Installing source-map@^0.6.1[vue-loader-v16@npm:vue-loader@^16.1.0] optional install error: Error: Unsupported URL Type: npm:vue-loader@^16.1.0
    at parseUrl (/usr/local/lib/node_modules/cnpm/node_modules/npm-package-arg/npa.js:186:13)
    at npa (/usr/local/lib/node_modules/cnpm/node_modules/npm-package-arg/npa.js:79:12)
    at _install (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/install.js:62:11)
    at _install.next (<anonymous>)
    at onFulfilled (/usr/local/lib/node_modules/cnpm/node_modules/co/index.js:65:19)
    at /usr/local/lib/node_modules/cnpm/node_modules/co/index.js:54:5
    at new Promise (<anonymous>)
    at co (/usr/local/lib/node_modules/cnpm/node_modules/co/index.js:50:10)
    at toPromise (/usr/local/lib/node_modules/cnpm/node_modules/co/index.js:118:63)
    at next (/usr/local/lib/node_modules/cnpm/node_modules/co/index.js:99:29)
✔ Installed 17 packages
✔ Linked 952 latest versions
[1/3] scripts.install @vue/[email protected][email protected][email protected][email protected][email protected] › fsevents@^1.2.7 run "node install.js", root: "/Users/ivyone/daily-cost/node_modules/[email protected]@fsevents"
gyp WARN EACCES user "ivyone" does not have permission to access the dev dir "/Users/ivyone/.node-gyp/14.15.5"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/var/folders/l9/kpwnx6f551d69kvflqcjbnsr0000gn/T/.node-gyp"
gyp http GET https://npm.taobao.org/mirrors/node/v14.15.5/node-v14.15.5-headers.tar.gz
gyp http 200 https://npm.taobao.org/mirrors/node/v14.15.5/node-v14.15.5-headers.tar.gz
gyp http GET https://npm.taobao.org/mirrors/node/v14.15.5/SHASUMS256.txt
gyp http 200 https://npm.taobao.org/mirrors/node/v14.15.5/SHASUMS256.txt
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/cnpm/node_modules/node-gyp/lib/configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/cnpm/node_modules/npminstall/node-gyp-bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ivyone/daily-cost/node_modules/[email protected]@fsevents
gyp ERR! node -v v14.15.5
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
[1/3] scripts.install @vue/[email protected][email protected][email protected][email protected][email protected] › fsevents@^1.2.7 finished in 3s
[2/3] scripts.postinstall @vue/[email protected] › @vue/[email protected][email protected] › ejs@^2.6.1 run "node ./postinstall.js", root: "/Users/ivyone/daily-cost/node_modules/[email protected]@ejs"
Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

[2/3] scripts.postinstall @vue/[email protected] › @vue/[email protected][email protected] › ejs@^2.6.1 finished in 86ms
[3/3] scripts.postinstall core-js@^3.6.5 run "node -e \"try{require('./postinstall')}catch(e){}\"", root: "/Users/ivyone/daily-cost/node_modules/[email protected]@core-js"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

[3/3] scripts.postinstall core-js@^3.6.5 finished in 84ms
✔ Run 3 scripts
peerDependencies WARNING @vue/[email protected] › @vue/cli-service@~4.5.0 requires a peer of vue-template-compiler@^2.0.0 but none was installed
deprecate @vue/[email protected] › @vue/[email protected] › request@^2.88.2 request has been deprecated, see https://github.com/request/request/issues/3142
deprecate @vue/[email protected] › @vue/[email protected][email protected] › har-validator@~5.1.3 this library is no longer supported
deprecate @vue/[email protected] › @vue/[email protected] › @hapi/joi@^15.0.1 joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
deprecate @vue/[email protected] › @vue/[email protected] › @hapi/[email protected] › @hapi/[email protected] This version has been deprecated and is no longer supported or maintained
deprecate @vue/[email protected] › @vue/[email protected] › @hapi/[email protected] › @hapi/[email protected] This version has been deprecated and is no longer supported or maintained
deprecate @vue/[email protected] › @vue/[email protected] › @hapi/[email protected] › @hapi/[email protected] This version has been deprecated and is no longer supported or maintained
deprecate @vue/[email protected] › @vue/[email protected] › @vue/[email protected] › html-webpack-plugin@^3.2.0 3.x is no longer supported
deprecate @vue/[email protected] › @vue/[email protected] › @hapi/[email protected] › @hapi/[email protected] This version has been deprecated and is no longer supported or maintained
deprecate @vue/[email protected][email protected][email protected][email protected] › chokidar@^2.1.8 Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
deprecate @vue/[email protected][email protected][email protected][email protected][email protected] › urix@^0.1.0 Please see https://github.com/lydell/urix#deprecated
deprecate @vue/[email protected][email protected][email protected][email protected][email protected] › fsevents@^1.2.7 fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
Recently updated (since 2021-02-24): 47 packages (detail see file /Users/ivyone/daily-cost/node_modules/.recently_updates.txt)
  Today:
    → @vue/[email protected] › @vue/[email protected] › @babel/[email protected][email protected] › electron-to-chromium@^1.3.649(1.3.678) (03:02:39)
    → @vue/[email protected] › @vue/[email protected] › vue-style-loader@^4.1.2(4.1.3) (16:02:35)
✔ All packages installed (1125 packages installed from npm registry, used 18s(network 14s), speed 1.02MB/s, json 969(2.6MB), tarball 12.07MB)
ivyone@ivyonedeMacBook-Pro daily-cost % cnpm run serve

> [email protected] serve /Users/ivyone/daily-cost
> vue-cli-service serve

 INFO  Starting development server...
 ERROR  Error: Cannot find module 'vue-loader-v16/package.json'
Require stack:
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/config/base.js
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/bin/vue-cli-service.js
Error: Cannot find module 'vue-loader-v16/package.json'
Require stack:
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/config/base.js
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/bin/vue-cli-service.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 /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/config/base.js:114:23
    at /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js:236:40
    at Array.forEach (<anonymous>)
    at Service.resolveChainableWebpackConfig (/Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js:236:26)
    at Service.resolveWebpackConfig (/Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js:240:48)
    at PluginAPI.resolveWebpackConfig (/Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/PluginAPI.js:132:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /Users/ivyone/.npm/_logs/2021-03-03T11_56_34_789Z-debug.log
ivyone@ivyonedeMacBook-Pro daily-cost % cnpm install 
✔ Installed 17 packages
✔ Linked 0 latest versions
✔ Run 0 scripts
✔ All packages installed (used 18ms(network 16ms), speed 0B/s, json 0(0B), tarball 0B)
ivyone@ivyonedeMacBook-Pro daily-cost % cnpm run serve

> [email protected] serve /Users/ivyone/daily-cost
> vue-cli-service serve

 INFO  Starting development server...
 ERROR  Error: Cannot find module 'vue-loader-v16/package.json'
Require stack:
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/config/base.js
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/bin/vue-cli-service.js
Error: Cannot find module 'vue-loader-v16/package.json'
Require stack:
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/config/base.js
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js
- /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/bin/vue-cli-service.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 /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/config/base.js:114:23
    at /Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js:236:40
    at Array.forEach (<anonymous>)
    at Service.resolveChainableWebpackConfig (/Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js:236:26)
    at Service.resolveWebpackConfig (/Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/Service.js:240:48)
    at PluginAPI.resolveWebpackConfig (/Users/ivyone/daily-cost/node_modules/_@[email protected]@@vue/cli-service/lib/PluginAPI.js:132:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /Users/ivyone/.npm/_logs/2021-03-03T11_57_58_067Z-debug.log
ivyone@ivyonedeMacBook-Pro daily-cost % cnpm i --save-dev vue-loader-v16
✔ Installed 1 packages
✔ Linked 9 latest versions
✔ Run 0 scripts
✔ All packages installed (3 packages installed from npm registry, used 500ms(network 497ms), speed 56.02kB/s, json 10(27.84kB), tarball 0B)
ivyone@ivyonedeMacBook-Pro daily-cost % cnpm run serve

> [email protected] serve /Users/ivyone/daily-cost
> vue-cli-service serve

 INFO  Starting development server...
40% building 92/103 modules 11 active /Users/ivyone/daily-cost/node_modules/[email protected]@vue-style-loader/lib/listToStyles.js[@vue/compiler-sfc] compileTemplate now requires the `id` option.`.

98% after emitting CopyPlugin

 DONE  Compiled successfully in 6531ms                                                                                                              下午8:01:17


  App running at:
  - Local:   http://localhost:8080/ 
  - Network: http://192.168.3.11:8080/

  Note that the development build is not optimized.
  To create a production build, run yarn build.






你可能感兴趣的:(vue,npm)