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

Install via yarn returns prompt to use yarn. #38501

Closed
JoshStrobl opened this issue Nov 16, 2017 · 5 comments
Closed

Install via yarn returns prompt to use yarn. #38501

JoshStrobl opened this issue Nov 16, 2017 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@JoshStrobl
Copy link

JoshStrobl commented Nov 16, 2017

  • VSCode Version: git (67cd925)
  • OS Version: Linux goliath 4.13.12-32.current #1 SMP Wed Nov 8 19:07:57 UTC 2017 x86_64 GNU/Linux

Steps to Reproduce:

  1. Run yarn (installed globally) during build
  2. See output
+ yarn
yarn install v1.3.2
$ node build/npm/preinstall.js
*** Please use yarn to install dependencies

The + before yarn merely denotes during our build what command is being run and is not part of the command itself. Running yarn as a replacement for npm install as per #38481

Further notes:

  • Yes, this is a clean build. All builds are done in a new, clean build environment (so we can have reproducible builds).
@JoshStrobl
Copy link
Author

If I remove lines 15 to 18 on build/npm/preinstall.js it goes about installing the dependencies as expected.

@joaomoreno
Copy link
Member

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Nov 17, 2017
@JoshStrobl
Copy link
Author

undefined is the value of npm_execpath, both in our build env and outside it (host).

NPM for us: usr/bin/npm: symbolic link to ../lib/node_modules/npm/bin/npm-cli.js, where this is provided by our nodejs package: Package nodejs has file /usr/lib/node_modules/npm/bin/npm-cli.js

@joaomoreno
Copy link
Member

joaomoreno commented Nov 17, 2017

While executing build/npm/preinstall.js, as part of yarn install, can you find any environment variable which points to yarn as being the package manager used, instead of npm?

Simply add the following to preinstall.js to find out:

console.log(process.env);
process.exit(1);

@JoshStrobl
Copy link
Author

JoshStrobl commented Nov 17, 2017

Not sure why my test code earlier was reporting it as undefined. Regardless, value is /usr/lib64/node_modules/yarn/bin/yarnpkg when I do console.log(process.env['npm_execpath']);

Seems to fail because it's checking for yarn.js and not the executable yarnpkg (we build our yarn and ship it as a package).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants