to you, sir! I did not know about this npm featureā¦ and I had always wondered about how devs can make sure theyāre all using the same exact version of a package. Thank you!
If Iām not mistaken, meteor npm
is just there to make 100% sure that the right version of npm is being used, in case the user has an older/newer version of npm on their system.
(BTW, you misquoted Serkan instead of me)
you may also find this interesting if you wanna learn a bit more about npm, or are looking for solutions to npm package hell Even getting consistent shrinkwrap is a black art.
Just donāt use yarn with Meteor! It may be tempting at first, because yarn does package installations/upgrades way faster than npm, but itās not compatible with Meteor.
Hey guys, as long as your system npm version === meteor npm version, npm commands will yield the same results. But suffice it to say, even minor version differences may end up with anywhere from subtle to grand inconsistencies.
Using the meteor prefix with npm commands is always the safest and most cross-compatible choice.
Regarding, shrinkpack, the guide already discusses it and suggests shrinkpack for even more increased consistency.
Lastly, although node versions donāt seem inherently much important, you may end up trying out node commands for scripting reasons, or perhaps for spawning processes etc and meteor npm
ensures consistency there as well.
The best thing is, if you are developing exclusively with meteor, you donāt need to (in fact perhaps itās even best if you just donāt) install node/npm on your system.
If for any reason you need/want to, Iād suggest you take a look at NVM and manually make sure you have compatible npm versions installed on your preferred node version, too.
Another note: the only package Iāve run into issues with is bcrypt. It must be installed via meteor npm i --save bcrypt@0.8.7
. Just using plain npm
, for some reason, results in a different buildā¦ even though itās the same npm version. Go figure.
EDIT: This problem arises probably because bcrypt has to be built via node/node-gyp
Erm, are you using TypeScript? Because the very first line kind of tells me that you do.
Basically, whenever you use a 3rd party module from npm or Meteor, you also need the type definitions (i.e. FooModule.d.ts
) Otherwise youāll get this exact error.