Does Meteor 1.6 mean we can stop using `meteor npm`?


#1

As Meteor transitions to node 8, I’m wondering if I can start using npm (and more importantly yarn) without prefixing it with meteor. This has given me a ton of headaches over my experience with meteor, and still prevents me from using yarn today as I keep getting old bcrypt errors if I don’t.

As I don’t fully understand the intricacies of meteor npm, will Meteor 1.6 allow me to use npm and yarn natively or will it still need to use meteor’s node version?


#2

As long as you have the same version of node and npm installed on your machine as the Meteor release uses, you won’t run into any problems leaving out the Meteor (Which has always been the case)

The advantage of meteor npm is that it will always use the version of node and npm that that release of Meteor was built and tested with, regardless of how many different Meteor projects of different releases you have on your computer.

The main reason it’s important is because different versions of Node ship with different versions of V8, and node’s native addons (like fibers which are used extensively in Meteor) must be compiled and run with the target version of V8/node. Using meteor npm is designed to save you from the complications involved in version mismatches


#3

Simple answer is no.

meteor npm does 2 things:

  1. Like @coagmano identified, it makes sure that it uses the right version that matches the development bundle. And makes is compatible with all of the meteor installed tools. (e.g. debugger versions, bcrypt compilation, etc.)
  2. More importantly, the version of npm is linked to the development bundle. That is, the meteor team has installed specific global modules within the development bundle that are expected to be there for meteor apps and npm installation. Installing with meteor npm will utilize those global modules if necessary. Otherwise you will have to find out what you are missing by trial and error and you run the risk of installing incompatible versions that are untested/unsupported but may work.
    Think of this like a completely new npm environment installed within the scope of meteor that has all the right stuff installed for you.

I got all tangled up when I first started using meteor because I did all my installation via direct npm commands. I do not recommend it. Save yourself the hassle.


#4

bcrypt errors or warnings?


#5

I get these too - warnings about using the slower pure javascript implementation of bcrypt.

If i try to install the faster version with npm it fails.


#6

you could make a bash alias so that when you run npm it runs meteor npm for you