2

Im trying to run

npm run serve

on a certain project.

and I get

vue-notus@1.1.0 serve F:\WEB_DEV\Github\vue-notus-main vue-cli-service serve

ERROR  You are using Node v13.14.0, but vue-cli-service requires 
Node ^12.0.0
Please upgrade your Node version.

Which is confusing. Its asking me to upgrade but I clearly have a higher version that ^12.0??

Or does it want me to downgrade??

Whats happening here?

Kylie
  • 11,421
  • 11
  • 47
  • 78

2 Answers2

3

The current version of @vue/cli-service requires

"node": "^12.0.0 || >= 14.0.0"

but the error message doesn't show that for some reason.

Upgrade to Node >= 14; 13.x is not a LTS release, which is likely why it's not explicitly supported.

Node 16.x is the current LTS release.

AKX
  • 152,115
  • 15
  • 115
  • 172
  • Sweet, thanks! Upgraded to 16 and it worked. – Kylie Dec 01 '21 at 03:53
  • 1
    I have the same problem and I'm on windows 7 which only supports Node v13. Is there any possible way to use Vue CLI? – castbound Feb 22 '22 at 02:56
  • 1
    @castbound Windows 7 hasn't been supported for two years. Nevertheless see https://stackoverflow.com/a/64626035/51685 – AKX Feb 22 '22 at 07:22
2

The carat at the start of a version in package.json indicates that you must have a major version that is equal to the version specified.

According to the semver documentation:

Allows changes that do not modify the left-most non-zero element in the [major, minor, patch] tuple. In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for versions 0.X >=0.1.0, and no updates for versions 0.0.X.

That is to say, your Node version of 13.14.0 is outside of the range 12.x.x (which is required by your version of vue-cli-service).

You will either need to downgrade Node, or upgrade vue-cli-service.

Obsidian Age
  • 41,205
  • 10
  • 48
  • 71
  • The explanation is correct, but the solution is not correct in the case of `@vue/cli-service`; see my answer... – AKX Dec 01 '21 at 04:02