How to specify/enforce a specific node.js version to use in package.json?

后端 未结 4 2170
北荒
北荒 2021-02-07 06:35

I am searching for a way to break the build, if a user is using a different node.js version as defined in the project.

Ideally to put some checks in grunt or bower or np

4条回答
  •  既然无缘
    2021-02-07 07:04

    You can use the "engineStrict" property in your package.json

    Check the docs for more information: https://docs.npmjs.com/files/package.json

    Update on 23rd June 2019

    "engineStrict" property is removed in npm 3.0.0.

    Reference : https://docs.npmjs.com/files/package.json#enginestrict

提交回复
热议问题