add engine-strict flag to npm install args #2965
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR adds
--engine-strict
flag to the npm install command for installing custom nodes. This flag ensures that if a specific nodejs version is included under engines section inpackage.json
the npm install command will fail if it does not satisfy the nodejs version requirements rather than only generate a warning message.to use this feature , a node developer adds an engines section in
package.json
and specify the version requirements such as{ "engines" : { "node" : ">=0.11.15" } }
This is tested to check for a specific nodejs version. This could possibly be extended to also stipulate a minimum node-red version which will be very useful to ensure that end users are not installing any incompatible nodes which will prevent node-red to load in some cases [however, using this flag to check for node-red version is not tested]
Checklist
grunt
to verify the unit tests passrunning grunt failed at
1) externalModules api checkFlowDependencies:
I don't know whether the change caused grunt to fail or is it something else?! first PR so I am not sure whether I need to update the unit test or not. Please let me know