11

So I'm having a problem with PhantomJS package. Here is a brief log detail:

npm ERR! node v4.2.4
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.

Having run into this issue has made me think about how I can find out if a package is compatible with a certain version of node? I'm wondering if there is a specific Node resource/guide you could use to check package compatibility, or what processes others in the community use to check this stuff?

2 Answers 2

13

Package maintainers can specify compatible Node.js versions in the engine field in package.json of their package. See the documentation on this here:

https://docs.npmjs.com/files/package.json#engines

However this field is not mandatory, so there is a great number of packages that do not provide information on compatible versions. If package.json doesn't contain engines field, it worth checking the package documentation, sometimes it contains compatibility information.

5
npm view [email protected] dependencies 
{ 'loose-envify': '^1.1.0', 'object-assign': '^4.1.1' }

npm view [email protected] engines
{ node: '>=0.10.0' }

npm view <package> peerDependencies

Using engines you can check require node version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.