Node version needs upgrading?? but its higher than what its recommending? - node.js

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?

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.

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.

Related

Why do pre NodeJS builds show up as less than older versions?

I tend to compile my NodeJS installs from source. This typically means the version ends up being something like 17.0.0-pre. When I am trying to build the zwavejs2mqtt I get
To use this template, you must update following to modules:
node: 17.0.0-pre should be >= 12.0.0
How can I tell it that 17.0.0-pre is larger than 12?
Things I have tried:
Ensuring that NPM is completely up to date.

Why my Nodejs gets automatically upgraded to the latest version of Nodejs after sometime?

I have a previous version of node installed but after few days it gets automatically updated to the latest version. I do not want it to upgrade itself to a newer version.
You need to specify the exact node version in your package.json file.
A bit of background, from the NPM documentation:
It's important to communicate the extent of changes in a new release of code, because sometimes updates can break code that a package needs (called dependencies).Semantic versioning (semver) is a standard that was designed to solve this problem.
From your terminal, type node --version; you will get a number formatted as X.X.X
Open your package.json file and remove any ~ or ^ signs from the node version you want to use so that it won't update to any minor or batch changes.
enter npm install in your terminal again and you are done.

How to relate a version of #types to the versions of the associated package in NodeJS Typescript?

I am working on a nodejs project with typescript 2.2 that is using node 6.3.1 and I want to migrate from using typings to using #types. By doing so I ran into a set of questions related to whether there is a relationship between the version of the #types file and the corresponding npm package.
If I use jasmine as an example, the existing versions of the types definitions are
npm show #types/jasmine#* version
#types/jasmine#1.3.0 '1.3.0'
#types/jasmine#1.3.1 '1.3.1'
#types/jasmine#1.3.2 '1.3.2'
#types/jasmine#2.2.29 '2.2.29'
#types/jasmine#2.2.30 '2.2.30'
#types/jasmine#2.2.31 '2.2.31'
#types/jasmine#2.2.32 '2.2.32'
#types/jasmine#2.2.33 '2.2.33'
#types/jasmine#2.2.34 '2.2.34'
#types/jasmine#2.5.35 '2.5.35'
#types/jasmine#2.5.36 '2.5.36'
#types/jasmine#2.5.37 '2.5.37'
#types/jasmine#2.5.38 '2.5.38'
#types/jasmine#2.5.39 '2.5.39'
#types/jasmine#2.5.40 '2.5.40'
#types/jasmine#2.5.41 '2.5.41'
#types/jasmine#2.5.42 '2.5.42'
#types/jasmine#2.5.43 '2.5.43'
#types/jasmine#2.5.44 '2.5.44'
#types/jasmine#2.5.45 '2.5.45'
#types/jasmine#2.5.46 '2.5.46'
But if I examine the versions of the jasmine packages I have;
npm show jasmine#* version
jasmine#2.0.1 '2.0.1'
jasmine#2.1.0 '2.1.0'
jasmine#2.1.1 '2.1.1'
jasmine#2.2.0 '2.2.0'
jasmine#2.2.1 '2.2.1'
jasmine#2.3.0 '2.3.0'
jasmine#2.3.1 '2.3.1'
jasmine#2.3.2 '2.3.2'
jasmine#2.4.0 '2.4.0'
jasmine#2.4.1 '2.4.1'
jasmine#2.5.0 '2.5.0'
jasmine#2.5.1 '2.5.1'
jasmine#2.5.2 '2.5.2'
jasmine#2.5.3 '2.5.3'
Let’s say I am using version 2.4.0 of jasmine, which version of #types/jasmine should I pick? Because even if I use the latest of both, 2.5.46 does not match with 2.5.3.
Another example would be node itself, there are basically 6.0 or 7.0 versions in #types, and typings has only the ones shown below, being 6.0 reported as obsolete. So, what version of node are those typings actually tied to?
typings view dt~node --versions
TAG VERSION DESCRIPTION COMPILER LOCATION
UPDATED
7.0.0+20170322231424 7.0.0 github:DefinitelyTyped/DefinitelyTyped/node/index.d.ts#a4a912a0cd1849fa7df0e5d909c8625fba04e49d 2017-03-22T23:14:24.000Z
6.0.0+20161121110008 6.0.0 github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#fb7fbd28b477f5e239467e69397ed020d92817e7 2016-11-21T11:00:08.000Z
Thanks
The major and minor versions of the DefinitelyTyped packages are supposed to correspond to the major and minor versions of the package they are types for. The patch version increments whenever the .d.ts file changes for other reasons. Because the minor version shouldn't represent breaking changes, in theory, you can use the highest 2.x.y definition file available for a 2.a.b.c library.
But now the caveats begin.
The header in the definition file may not have changed at the right time
Library authors do not necessarily follow semver*
The definition file may not be 100% correct at any given point, in either direction (i.e. listing a 2.6 feature under a 2.5 version, or failing to list a 2.4 in function in the 2.5 file)
* In fact, no one does
A detailed explanation can be found in official docs FAQ: How do Definitely Typed package versions relate to versions of the corresponding library?

"no template named 'WeakCallbackData' in namespace 'v8'" error when installing npm packages

Some packages that depend on https://www.npmjs.com/package/fibers fail to install with error message above. Particularly it is iron-meteor.
Homepage of the fibers states:
meteor users please read this
If you're trying to get meteor running and you ended up at this page you're probably doing something wrong. Please uninstall all versions of NodeJS and Meteor, then start over. See meteor#5124 for more information."
But it does not seem to be very helpful.
One guy recommends to downgrade node.js here https://github.com/NativeScript/NativeScript/issues/2991
It helps indeed, but it is kind of hack, right?
Node version affected: v7.2.0
Node v6.9.2 works well.
WeakCallbackData was removed from the V8 API earlier this year. Since this change has landed in Node 7, packages that rely on v8::WeakCallbackData don't work anymore. You need to downgrade Node or wait until Meteor supports Node 7, i.e., uses a newer node-fibers version.

Can you change the node version on tonicdev.com?

Tonic allows you to run node code in the browser ... https://tonicdev.com/
But its currently running 0.12.7 of node
Can you change the node version when using Tonic? i've searched but can't find anything - thought someone might now.
My npm module fails on anything below node 4.
you can in fact change the version, If you look under the title of the notebook you will see where it says "node 0.12" and if you click that you can select the version. Although the only currently supported versions are 0.10,0.12, and iojs 2.3. I would try seeing if iojs works for you, but if not, node 4 is coming shortly.

Resources