-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency between node versions of npm and yarn #812
Comments
From my point of view, there should be a heads-up in Installation documentation when installing yarn using package repositories. |
@hiendv - did |
@leebenson It actually did. Could you please post the results of |
On MacOS Sierra 10.12.1 Beta |
vim $(which yarn)
var ver = process.versions.node;
console.log(ver)
|
Executing
Same problem. |
Interesting. Your case is different. "engines": {
"node": "^5.3",
"npm": "^3.5"
} which is totally incompatible with your node v6.7.0. It's because of the package itself. However, the author already fixed it in the next release. "engines": {
"node": ">= 5.3",
"npm": ">= 3.5"
} |
nicely spotted! Thanks @hiendv I've asked the parent package to bump. I'll look for the patch mentioned here to land too, which should help workaround the issue of deeply nested dependencies with broken |
You're welcome @leebenson. |
The main difference is that npm is shipped with node while yarn isn't. |
There's a note about configuring the NodeSource repository but I don't think it's stated clearly and correctly enough.
It's true to say if we install nodejs from the NodeSource repository and use it (e.g. If a user uses another version of node (and npm), e.g. |
@leebenson what is strange that quill bumped dependency to |
This sounds confusing... Is it intentional that you have two different Node.js versions? I'd suggest just having a single version of Node.js installed 😄 Is there an issue with our Debian package that's causing it to use the wrong Node.js version? |
@Daniel15 do some of the install options come with a specific version of node? |
@thejameskyle None of them are bundled with Node. The Debian/Ubuntu package "recommends" the Windows installer doesn't check for Node any more, so Yarn will just fail to run if they install Yarn but don't install Node.js. |
Going to close this out as #1142 should help with inconsistencies around Node.js in Debian. @hiendv - To fix your current situation, I think you should I think the ideal fix is to use the native package management system of your operating system rather than using |
I think I have the same issue as described here. I do indeed have multiple versions of
Here's some additional info to complicate matters:
When I try to run
The I can workaround it with |
Although my opinion remains, I cannot reopen the issue. Looking forward to hearing from @Daniel15 |
Just put your 'preferred' version of Node (ideally the newer one) earlier in your
It's working as expected then? If the package specifies that it only works on Node 6 and above, it should indeed fail on Node 4.8.1. Sorry if I'm missing something here. If the package works on an older version, they should not have that section in the package.json. |
@Daniel15 Haha, you're right, that is a greater than, not a less than! It's not always possible to change the $PATH. In our case, it's modified by both |
Can Meteor upgrade its archaic Node.js version to a more modern one? I feel like this is actually a Meteor issue and not a Yarn issue. |
@Daniel15: The next release will upgrade node, but I think the more general use case of specifying which version of node yarn should consider as "installed" is what's at issue here. In my opinion, it's a very valid scenario to have multiple versions of node installed and to want to specify which one yarn should use for engines checks. |
How would you specify which one to use though? I agree that it's a valid scenario to have multiple versions of Node.js installed, however I feel like it's extremely uncommon to run one version of Node.js while installing packages for a totally different version of Node.js (eg. using Node 4 to install packages that will actually be used on Node 6) 😃 |
@Daniel15 Hmm, yes, you're right. Makes sense. Fair point. I was going to write up a feature request to specify which version of node should be considered for engine checks, but actually, you make an excellent point. I think this whole thing started because I misread the version constraint and thought something weird was happening, but it wasn't. Sorry for the noise, thanks for the patience. |
It worked for me after I installed latest stable version of node ( https://nodejs.org/en/ ) |
Do you want to request a feature or report a bug? Reporting a bug
What is the current behavior? Inconsistency between the version of node which yarn's running on and the current version of node (
node --version
) may cause errors likeIf the current behavior is a bug, please provide the steps to reproduce.
vim $(which yarn)
These versions should be different.
yarn add
any packages whose engine requirement is satisfied by only one of these twoWhat is the expected behavior?
Yarn should share the same version of node engine.
Please mention your node.js, yarn and operating system version.
node -v
: 6.7.0npm -v
: 3.10.8yarn --version
: 0.15.0 which is installed via the Debian package repositoryOS
: Ubuntu 16.04.1 LTSCurrent workaround
Using
npm i -g yarn
The text was updated successfully, but these errors were encountered: