I had node 16.15.1 installed and I need and older version (10) for another project so I installed nvm, installed node 10 and switched (nvm use 10) to that version to install the node packages for that project (lets say project B).
Now I switched to project A and executed npm run serve
and it complied saying that I use node 10. I executed nvm use 16
and run again, same problem. Double checked it with node --version
and it said that I use v.16 and from nvm list
I got the two versions but it said that I use v.16.
Now I have uninstalled both versions and reinstalled only v.16 and it still complains about the version
> nvm ls
16.15.1 (Currently using 64-bit executable)
> npm run serve
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
> single-stylist-website@0.1.0 serve
> vue-cli-service serve
ERROR You are using Node v10.15.2, but vue-cli-service requires Node ^12.0.0 || >= 14.0.0.
Please upgrade your Node version.
> node --version
v16.15.1
Steps that I did trying to get rid of the v.10
- I deleted all node versions from nvm folder.
- I deleted node from control panel
- I also restarted my pc and tried with multiple cmd window to be sure that I wasn't some problem with that cmd window
I don't understand why it won't switch to v.16 because when I switch from v.16 to v.10 it worked perfectly. Now when I tried to switch from v.10 to v.16 it got stuck on v.10 somewhere
UPDATE
package.json
{
"name": "single-stylist-website",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"engines": {
"node" : ">=14.0.0"
},
"dependencies": {
"axios": "^0.27.2",
"core-js": "^3.8.3",
"npm": "^8.12.1",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vuex": "^4.0.2"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}
I created a new project and copy pasted everything but node_modules,
run npm install`` and then
npm run serve``` and know everything works.
Possible cause:
I have red know the docs carefuly and saw that you need to delete node before installing nvm so I delete everything related to node, npm, nvm. Including the env variables