Subscribe on changes!

an init project can't work with npm

avatar
Oct 31st 2020

Version

3.0.2

Steps to reproduce

1.When i init the project by vue-cli 4.5.X,I can start the project by yarn && yarn serve. but when i delete the node_modules,then use npm install && npm run serve,it will show me can't some packages,show as follow

⠙ [8/27] Installing tsutils@^3.17.1[fork-ts-checker-webpack-plugin-v5@npm:fork-ts-checker-webpack-plugin@^5.0.11] optional install error: Error: Unsupported URL Type: npm:fork-ts-checker-webpack-plugin@^5.0.11
    at parseUrl (/usr/local/lib/node_modules/cnpm/node_modules/_npm-package-arg@4.2.1@npm-package-arg/npa.js:186:13)
    at npa (/usr/local/lib/node_modules/cnpm/node_modules/_npm-package-arg@4.2.1@npm-package-arg/npa.js:79:12)
    at _install (/usr/local/lib/node_modules/cnpm/node_modules/_npminstall@3.28.0@npminstall/lib/install.js:62:11)
    at _install.next (<anonymous>)
    at onFulfilled (/usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:65:19)
    at /usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:54:5
    at new Promise (<anonymous>)
    at co (/usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:50:10)
    at toPromise (/usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:118:63)
    at next (/usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:99:29)
⠴ [18/27] Installing unique-filename@^1.1.1
WARN node unsupported "node@v12.16.0" is incompatible with @vue/cli-plugin-babel@4.5.8 › webpack@4.44.2 › watchpack@1.7.4 › watchpack-chokidar2@^2.0.0, expected node@<8.10.0
⠇ [25/27] Installing lodash@^4.17.14[vue-loader-v16@npm:vue-loader@^16.0.0-beta.7] optional install error: Error: Unsupported URL Type: npm:vue-loader@^16.0.0-beta.7
    at parseUrl (/usr/local/lib/node_modules/cnpm/node_modules/_npm-package-arg@4.2.1@npm-package-arg/npa.js:186:13)
    at npa (/usr/local/lib/node_modules/cnpm/node_modules/_npm-package-arg@4.2.1@npm-package-arg/npa.js:79:12)
    at _install (/usr/local/lib/node_modules/cnpm/node_modules/_npminstall@3.28.0@npminstall/lib/install.js:62:11)
    at _install.next (<anonymous>)
    at onFulfilled (/usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:65:19)
    at /usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:54:5
    at new Promise (<anonymous>)
    at co (/usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:50:10)
    at toPromise (/usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:118:63)
    at next (/usr/local/lib/node_modules/cnpm/node_modules/_co@4.6.0@co/index.js:99:29)

What is expected?

it can install package can work with npm

What is actually happening?

when i use npm run serve

 ERROR  Error: Cannot find module 'vue-loader-v16/package.json'
Require stack:
- /Users/ibaiwei/Desktop/f1/node_modules/_@vue_cli-service@4.5.8@@vue/cli-service/lib/config/base.js
- /Users/ibaiwei/Desktop/f1/node_modules/_@vue_cli-service@4.5.8@@vue/cli-service/lib/Service.js
- /Users/ibaiwei/Desktop/f1/node_modules/_@vue_cli-service@4.5.8@@vue/cli-service/bin/vue-cli-service.js
Error: Cannot find module 'vue-loader-v16/package.json'

my package.json like this

  "dependencies": {
    "core-js": "^3.6.5",
    "vue": "^3.0.0",
    "vue-router": "^4.0.0-0",
    "vuex": "^4.0.0-0"
  },
"devDependencies": {
    "@types/chai": "^4.2.11",
    "@types/mocha": "^5.2.4",
    "@typescript-eslint/eslint-plugin": "^2.33.0",
    "@typescript-eslint/parser": "^2.33.0",
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-typescript": "~4.5.0",
    "@vue/cli-plugin-unit-mocha": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "@vue/eslint-config-prettier": "^6.0.0",
    "@vue/eslint-config-typescript": "^5.0.2",
    "@vue/test-utils": "^2.0.0-0",
    "chai": "^4.1.2",
    "eslint": "^6.7.2",
    "eslint-plugin-prettier": "^3.1.3",
    "eslint-plugin-vue": "^7.0.0-0",
    "less": "^3.0.4",
    "less-loader": "^5.0.0",
    "prettier": "^1.19.1",
    "typescript": "~3.9.3"
  }
avatar
Oct 31st 2020

Hello, thank you for taking time filling this issue!

However, we kindly ask you to use our Issue Helper when creating new issues, in order to ensure every issue provides the necessary information for us to investigate. This explains why your issue has been automatically closed by me (your robot friend!).

I hope to see your helper-created issue very soon!

avatar
Jul 13th 2021

I had the same problem, here is a reproduction, try to run vue serve under pwa after bootup https://codesandbox.io/s/2533-ovbws?file=/sandbox.config.sh