Skip to content
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

Yarn seams to be using a different version of NPM #6617

Closed
ssylvia opened this issue Nov 1, 2018 · 10 comments
Closed

Yarn seams to be using a different version of NPM #6617

ssylvia opened this issue Nov 1, 2018 · 10 comments
Assignees
Labels

Comments

@ssylvia
Copy link

ssylvia commented Nov 1, 2018

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When running a script with yarn I get the following warning:

npm WARN npm npm does not support Node.js v10.13.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN lifecycle The node binary used for scripts is /var/folders/6_/ggyf3s1j6772klpkpzhmg_08s9xzsr/T/yarn--1541072250935-0.34762921316103146/node but npm is using /Users/{username}/.nvm/versions/node/v10.13.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

Please mention your node.js, yarn and operating system version.

which yarn

/usr/local/bin/yarn
Installed with homebrew

which node

/Users/{username}/.nvm/versions/node/v10.13.0/bin/node
Installed with nvm

which npm

/Users/step6692/.nvm/versions/node/v10.13.0/bin/npm

yarn --version

1.12.1

node --version

v10.13.0

npm --version

6.4.1

On MacOS Mojave 10.14 (18A391)

@ghost ghost assigned imsnif Nov 1, 2018
@ghost ghost added the triaged label Nov 1, 2018
@arcanis
Copy link
Member

arcanis commented Nov 1, 2018

Yarn has specific mechanisms to force the scripts it runs to use the exact same Node binary as the one used to run Yarn itself. It seems like npm conflicts with this because they do the opposite.

@kondei
Copy link

kondei commented Nov 2, 2018

I have the same problem.

@kondei
Copy link

kondei commented Nov 6, 2018

How can I fix it?
I can run nothing now.

@kondei
Copy link

kondei commented Nov 6, 2018

npm config set scripts-prepend-node-path true

seems to "fix" it...

@wKich
Copy link

wKich commented Nov 29, 2018

@arcanis can you explain why?

I switch node by using n cli. So binary in temp dir and global installation directory has same version. But I always receive this warning.

And more over yarn create new trash dir with node exec every time I call yarn
screenshot 2018-11-29 at 12 02 06

@smac89
Copy link

smac89 commented Dec 13, 2018

@kondei Another option is to include a .npmrc in the folder with that option in it.

See this SO answer: https://stackoverflow.com/a/51295237/2089675

@kondei
Copy link

kondei commented Dec 14, 2018

@smac89 I have already done so.
thank you. 👍

chriskrycho added a commit to chriskrycho/ts-generator that referenced this issue Sep 10, 2019
- Add `build` and `clean` scripts which use `npm run ...` to compatibly
  invoke the existing `build:js`, `build:types`, `clean:js`, and
  `clean:types` scripts.
- Work around [yarnpkg/yarn#6617] by adding a `.npmrc` file which sets
  the npm option to eliminate noise when invoking the joint scripts.

[yarnpkg/yarn#6617]: yarnpkg/yarn#6617
@BYK
Copy link
Member

BYK commented Oct 30, 2019

Closing as this is by design and there doesn't seem to be anything on our side to change or fix.

@BYK BYK closed this as completed Oct 30, 2019
dylankelly added a commit to dpc-sdp/ripple that referenced this issue Mar 29, 2020
* Fix changed image paths

* Adds tests for news

* Add alert test

* Add webform tests

* Add quickexit tests

* Fix publication test

* Add GTM test

* Re add sitemap test

* Add url test step

* Improve authenticated content test

* Update step definition to refer to node instead of page

* Working E2E tests

Working auth content test

Update circle CI to test this PR

disable chromeWebSecurity

Fix webform test

Fix auth content tests

fix quickexit

skip webform to diagnose timeout

Add circle step to run nightly on actual domain

use chrome browser and bump ram in CI

Add node 12 browser container

Remove browsers image and comment out failing alert test

fix news test

skip failing step in content preview test

fix publication test

update auth content yaml

Fix quickexit step

Use chrome instead of electron

Use form submit buttons to submit

fix preview content feature

Improve content preview test

Add a bit extra wait for CI

Fix news listing step

Add step to use preview link

remove  current url check

Use UUID for preview

Add waits in webform submission

More waits

more fixes

Better timeout handling on anchorlink test

Add grant test

Add nid for auth content and content preview

Add wait to content preview test

Add test for site section alert

Add wait for page navigation in anchorlink test

* Change alert title

* Add extra cleanup spec for alerts

* Extend timeout on preview redirect

* fix space in url

* Add tests into new project scaffolding

* Add tests into new project scaffolding

* Update packages/create-ripple-app/generators/updates/22.0.0/saofile.js

bump version in update script

Co-Authored-By: Tim Yao <31641325+tim-yao@users.noreply.github.com>

* Add siteid variable to smoke tests

* Use /user/login route to workaround BE issue

* Add scripts-prepend-node-path=true to fix yarn issue yarnpkg/yarn#6617

* Fix test regressions

* Fix conflicting nodeids for alerts

* use admin account for auth content

* extend wait for demolandingpage

* skip preview

* force select

* Add 2x parallelism

* Remove step that creates auth content taxonomy

* Fix content preview test

* remove quickexit cleanup

* Add a visit to homepage to warm cache before test

* Update CRA fixtures

Co-authored-by: Tim Yao <31641325+tim-yao@users.noreply.github.com>
joshuatz added a commit to joshuatz/glitch-static-build-cache that referenced this issue Sep 16, 2020
 - GH action (test) is failing, due to what looks like a `node binary`
 mismatch issue.
 - This might fix that, by putting the true binary in the path
 - See: yarnpkg/yarn#6617
@dmost714
Copy link

I just encountered this issue on an "out of the box" clean setup.
I installed MacOS Catalina (10.15.7) on a Macbook Pro.
Installed Homebrew via their suggested terminal blurb.
Installed Yarn (brew install yarn)
Attempted to build my Gatsby project, and received this error.
I typed "npm upgrade", and the error is gone.
Hope that works for someone else as well.

@craigphicks
Copy link

craigphicks commented Oct 26, 2021

It appears that the warning message can appear (and it does for me) even when yarn is calling the correct node
version. This can happen because yarn may call the correct node version through a shell script as follows -

$ cat /tmp/yarn--1635268434808-0.4758243621447591/node
#!/bin/sh

exec "/usr/local/bin/node" "$@"
$ which node
/usr/local/bin/node

In that case the debugger won't be loading two separate versions of node, so no problem, and the warning can be safely ignored.

@yarnpkg yarnpkg locked as resolved and limited conversation to collaborators Oct 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants