Works on osx; not on linux

:beers: 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.

1 Like

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.

1 Like

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.

2 Likes

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.