Ensure npm scripts find correct meteor executable. #9941
Merged
Conversation
In my local development environment, the `meteor` command resolves to my Meteor checkout, and I use `~/.meteor/meteor` explicitly when I want to run a released version of Meteor. If I run ~/.meteor/meteor npm test and the `package.json` file defines an npm `test` script that refers to `meteor`, in my environment this `meteor` won't be the same as the one I used to run `~/.meteor/meteor npm test`, which can introduce weirdness such as pinning the versions of packages in `meteor/packages/non-core`, and all the usual Meteor version inconsistency risks. This commit fixes that problem by prepending the directory that contains the `meteor` (or `meteor.bat`) executable to the `PATH` before running `meteor npm ...` commands.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In my local development environment, the
meteor
command resolves to my Meteor checkout, and I use~/.meteor/meteor
explicitly when I want to run a released version of Meteor.If I run
and the
package.json
file defines an npmtest
script that refers tometeor
, in my environment thismeteor
won't be the same as the one I used to run~/.meteor/meteor npm test
, which can introduce weirdness such as pinning the versions of packages inmeteor/packages/non-core
, and all the usual Meteor version inconsistency risks.This commit fixes that problem by prepending the directory that contains the
meteor
(ormeteor.bat
) executable to thePATH
before runningmeteor npm ...
commands.