[Solved] CI script installing Meteor fails

We always used the following command to install Meteor as part of our CI script in AWS CodePipeline:

meteor npm install --production

but it fails now with the following error:

/codebuild/output/tmp/script.sh: line 4: meteor: command not found
[Container] 2021/10/12 14:18:40 Command did not exit successfully meteor npm install --production exit status 127
[Container] 2021/10/12 14:18:40 Phase complete: PRE_BUILD State: FAILED
Container] 2021/10/12 14:18:40 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: meteor npm install --production. Reason: exit status 127

Can anyone tell me how the correct command is now?

Thanks in advance!

1 Like

How are you installing Meteor now? I noticed recently that when we switched from the old install script (using cURL) to the new one (using NPM), we also started seeing this meteor: command not found issue in our CI environment.

The fix was pretty straightforward, though: We just needed to update the PATH. I guess the old install script may have done this automatically in a way that took effect right away, whereas the new one doesn’t until you open a new terminal tab?

So, we did something like this to resolve it:

export PATH=$HOME/.meteor:$PATH

The exact code you need might be a little different depending on how you install Meteor and depending on how AWS CodePipeline lets you update PATH, of course. For us, we run something like this to install Meteor on CircleCI:

command -v meteor >/dev/null 2>&1 || (npm install --prefix=$HOME/.local -g meteor && echo 'export PATH=$HOME/.meteor:$PATH' >> $BASH_ENV)

The older version looked like this:

command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | /bin/sh
1 Like

After a long night of research we figure out that we need to add --insecure to our curl (as a workaround to be able to deploy again).

Indication was this part in our log file:

curl: (60) SSL certificate problem: certificate has expired

Oh, I should have added – we also started seeing that exact error on CircleCI a few days ago, which is what prompted us to look into switching from the cURL install script to the NPM version in the first place.

The Meteor docs have this to say:

For Linux and OS X, we are still providing the legacy installation method which uses a bash script and doesn’t depend on Node […] This installation method is not maintained anymore, and you should always use the NPM one.

So, it seems like the --insecure fix will work for now but that install method overall may stop working sometime in the future. Anyway, I’m glad you found a resolution that works for now!

1 Like