Unable to upgrade meteor to 1.8.1 or newer

Current version : 1.8.0.2
Want to upgrade to : latest
Current node version: v10.23.0
Current npm version: 6.14.9
Desktop: Ubuntu 20.04

I’m unable to update to a newer version of meteor for my application. Here is the entire npm log dump

The last log snippet:

 node-pre-gyp ERR! node -v v12.18.4
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@3.0.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bcrypt@3.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/wow-machine/.npm/_logs/2020-12-23T12_54_06_394Z-debug.log

Going by the logs, I notce node -v says v12.18.4. However, when I run node --version I get 10.23.0
I’d like to know what the issue could be and how to address the issue.

Thanks!

What command did you use?
First try to update to 1.8.1 via meteor update --release 1.8.1

I first tried meteor update --patch which failed. Then meteor update which also failed. I got rid of bcrypt by running meteor npm uninstall bcrypt None of them have worked so far.

You will want to get the latest version of bcrypt, so that was a good call. Updating other npm dependencies is also a good strategy.

Strangely, this has worked! I am not sure why.
However, subsequently running meteor update or meteor update --release 1.12 fails for the same reason!

Well, let’s take this one version at a time.

Let’s try meteor update --release 1.8.3
After that meteor update --release 1.9 <= I think this will be crucial due to upgrade from Node 8 to Node 12.

Thanks!

Was able to successfully upgrade to 1.8.3. But same failure with 1.9

Good! So now we know that the issue is probably related to the Node upgrade. Try removing your node_modules directory and try updating to 1.9 again.

Hmm. I got rid of the node_modules in the meteor app directory. Is this the node_modules dir you’re referring to? It didn’t help though. Same issue.

UPDATE_1:

I just did a fresh clone of my repo on a new server. Installed meteor and tried to do an update. The exact issue seems to be happening. Still clueless about what is going on.

But I did observe one thing. No matter what version I try to upgrade to, meteor-build tool@1.12 is what is always getting called - based on the logs at least!

/home/test/.meteor/packages/meteor-tool/.1.12.0.1nsaazu.paqa++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node"

UPDATE_2:

Is there a way I can force the use of meteor-tool v1.9?

I already tried getting rid of 1.12.0 in /home/test/.meteor/packages/meteor-tool and then creating a link to meteor from 1.9.0. But it still manages to download 1.12.0


rm /home/test/.meteor/meteor 
sudo ln -s packages/meteor-tool/1.9.0/mt-os.linux.x86_64/meteor /home/test/.meteor/meteor

UPDATE_3:

I commented out a few meteor packages and the upgrade went through. Will zero in on this after awhile.