S
S
sanex33392016-06-07 18:59:53
npm
sanex3339, 2016-06-07 18:59:53

How to specify required version of Node.js during installation?

I make a package, I write in TS, I compile in es6. Requires Node.js 6.0.0+ to work.
Is it possible to somehow specify in npm during installation that the node version is 6.0.0+, and stop the installation if the version is lower?
So far, only the preinstall script comes to mind, with a version check.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sanex3339, 2016-06-07
@sanex3339

You can specify the version of node that your stuff works on:
{ "engines" : { "node" : ">=0.10.3 <0.12" } }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question