V
V
vetsinen2018-03-21 14:35:06
Node.js
vetsinen, 2018-03-21 14:35:06

How to check node.js version before installing packages?

Good afternoon, is it possible to make the npm install command check the installed version of node and stop if there is no required version. on the project, one of the projects requires a node of version 7 and lower, and if higher, it simply gives a bunch of mysterious errors for which it is difficult to establish the reason
in the documentation. I found what can be done like this "engines" : { "node" : "<8.0" },
but Unfortunately, this option does not help in any way and a bunch of mysterious errors still fall.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2018-03-21
@sim3x

package.json
https://docs.npmjs.com/files/package.json#engines
{ "engines" : { "node" : ">=0.12" } }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question