"engines" setting in package.json

68 views
Skip to first unread message

Shane Niu

unread,
May 26, 2014, 10:07:31 PM5/26/14
to nod...@googlegroups.com
Hi,

I am trying to specify node version in package.json, but it seems not work.

I simply tried to give a wrong node version { "engines": { "node": "1.10.11"}} and "engineStrict": true.

Then I run both `npm install` and `npm start`, there is no complain from npm about node version.

I also tried to give a wrong npm version in the "engines" but it doesn't work as well.

Is there anything I misunderstand here? Thanks a lot!

jmar777

unread,
May 27, 2014, 10:08:27 AM5/27/14
to nod...@googlegroups.com
Did you mean "node": "0.10.11"?

Node 1.x.x doesn't exist yet; if you're looking for the latest stable version, that's currently 0.10.28.

Sam Roberts

unread,
May 27, 2014, 10:31:06 AM5/27/14
to nod...@googlegroups.com
On Mon, May 26, 2014 at 7:07 PM, Shane Niu <nius...@gmail.com> wrote:
> Hi,
>
> I am trying to specify node version in package.json, but it seems not work.

Its just advisory, pretty much. Mostly ignored, probably not worth putting in.

Read more here:

https://www.npmjs.org/doc/files/package.json.html

Daniel Rinehart

unread,
May 27, 2014, 10:31:06 AM5/27/14
to nodejs

My understanding is that the engines section is only consulted when your code is listed as a dependency in another project. While some platforms like Heroku use that field to determine the version of node to run your code with, when running locally it is ignored.

-- Daniel R. <dan...@neophi.com> [http://danielr.neophi.com/]

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/c1a0c119-27cc-4183-b08a-36853145199e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shane Niu

unread,
May 27, 2014, 7:28:08 PM5/27/14
to nod...@googlegroups.com
No. I intended to put a wrong version of node to see the complain from npm.

Shane Niu

unread,
May 27, 2014, 7:30:15 PM5/27/14
to nod...@googlegroups.com
If you read more on that page, you will see there is engineStrict field to force npm fail with wrong node version:)
Reply all
Reply to author
Forward
0 new messages