I recently updated my system from Ubuntu 21.10 to 22.04 and my meteor project was getting errors about loading a crypto shared library.
I deleted node_modules and ran meteor npm i but npm hangs, unless, I found, I remove googleapis from package.json.
I updated my project from Meteor 2.6 → 2.7.2
I’ve spent some time trying to figure this out but am not getting very far. Running npm install with my globally installed version of npm (8.5.5, instead of meteor’s version, 6.14.16) works perfectly fine.
Is using a later version of NPM sane, so long as it’s consistently used (and not mixed w/ meteor’s NPM)?
Hi @drone1, you should use node 14 and the npm version that comes with it. Meteor does not support yet node 16. Maybe that’s why you are facing this issue
I’m facing the issue because I updated Ubuntu from 21.10 to 22.04 LTS. That was the only thing that changed.
After updating running the server started showing errors about a dynamic library not being able to load (crypto-related), then the next time I ran meteor npm install it started hanging, unless I deleted the googleapis package. npm install works fine, meteor npm install does not.
I saw some npm threads about it on github and it’s an issue that was never resolved, which is why I wanted to see if I might be able to use a later version since it may be an npm bug.
I saw some people had tried re-installing npm, which in my case presumably would mean re-installing meteor – I can try that next.
last I checked you could use latest npm with Meteor, just need to update meteor’s copy with meteor npm i -g npm
I have run into version issues with googleapis before, so there might be something there. Unfortunately, as you found, their docs and GH issues are pretty useless
each Meteor version packages a node and npm with it. Using meteor node or meteor npm uses that pacakged version. The global install is then also scoped to only that version of node and npm for that version of Meteor
each Meteor version packages a node and npm with it. Using meteor node or meteor npm uses that pacakged version.
Yep, this I’m well aware of.
The global install is then also scoped to only that version of node and npm for that version of Meteor
So are you suggesting that meteor npm i -g npm would install that same version that Meteor is running, but globally?
The issue is that this version of npm causes things to hang w/ googleapis in package.json/npm-shrinkwrap.json – how would it help to install the bogus version globally?
Also I use nvm so it would probably be a mess if I were to let meteor adjust the global install.
I’d try installing 6.14.16 (Meteor’s NPM version) with nvm, but nvm won’t allow me to install 6.14.16 as it appears not to be an option.
Alright so I fixed it. Turns out it was not the googleapis package causing the issue. It’s because I have forked repos and my package.json points there. I saw that ls-remote was being called multiple times for a github URL for one of my forked repos, and that lead me to the workaround.
I just needed to add those 2 lines to ~/.gitconfig and that stopped the hanging. What those 2 lines are actually doing is not something I understand. Also: lol, what is that guys…
The following command now works every time without hanging: rm -rf node_modules && meteor npm cache clean --force && meteor npm i --ddd
No, the exact reverse. It would update the version of npm that is used with that specific version of Meteor. For example given these made up meteor versions: