-
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
npm install yarn --global fails in docker container #8358
Comments
We've added a preinstall script in the 1.22.6. Given that they need to ship outside of the standard release pipeline which is broken, they haven't generated formal GH releases (I added them to the changelog tho). Can you provide more details? In particular, can you explain why your setup cannot execute the
|
From what I can see (nvm-sh/nvm#1407), the problem is that you're installing nvm as root, and when npm runs the lifecycle scripts it downgrades the permissions, making it impossible to even run Node scripts, since the I'll make the script tolerant to such failures, but you might want to look at this, as running npm as root is perhaps not recommended. |
I've just released the 1.22.8 which uses the following script; it should prevent permission errors (since the script aims to make a future migration easier it's not a critical problem if it can't run), at the cost of the script not running anymore on Windows. I'll update the changelog.
|
We just did a deploy and the new version (1.22.8) got pulled in.. it gave us the following error:
|
That should be
I think |
@arcanis Can this be fixed real soon (v1.22.9)? It is blocking our work… |
Probably more like:
if the intention is to discard both stdout and stderr. |
Same for me but I don't have this trace root@bee39e307c36:/tmp# npm install -g yarn --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node',
npm verb cli '/usr/bin/npm',
npm verb cli 'install',
npm verb cli '-g',
npm verb cli 'yarn',
npm verb cli '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session 4403626286b4d9ec
npm http fetch GET 200 https://registry.npmjs.org/yarn 208ms
npm http fetch GET 200 https://registry.npmjs.org/yarn/-/yarn-1.22.8.tgz 199ms
npm timing stage:loadCurrentTree Completed in 452ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1ms
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 6ms
npm timing stage:loadIdealTree Completed in 10ms
npm timing stage:generateActionsToTake Completed in 5ms
npm verb correctMkdir /root/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /root/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
npm timing action:extract Completed in 106ms
npm timing action:finalize Completed in 3ms
npm timing action:refresh-package-json Completed in 15ms
npm info lifecycle [email protected]~preinstall: [email protected]
> [email protected] preinstall /usr/local/lib/node_modules/yarn
> :; (node ./preinstall.js >& /dev/null || true)
root@bee39e307c36:/tmp# echo $?
1
root@bee39e307c36:/tmp# npm --version
6.14.4 I'm on Docker with ubuntu focal version And maybe if command |
I've released 1.22.10 that should fix the fd error. Can you confirm it works on your side?
For future reference, you can (should) pin your version rather than use whatever the latest is on npm (by using |
1.22.10 works like a charm, @arcanis ; thanks for the speedy response! |
Don't work for me, but I'm going to use 1.22.5 version |
That sounds good - if you have an idea why is the execution failing, feel free to open another issue (to avoid us spamming other people from this thread). Without logs however, I won't be able to help much. Fwiw we don't plan to add any more features to Yarn 1, as all of our resources have shifted to Yarn 2. The past few commits have been aimed toward making the transition a bit easier, in particular thanks to the Corepack initiative which we hope will make it easier to use Yarn (both 1 & 2) by removing the need to manually install them. In the meantime, sorry for the disruption. I hope things will work fine now 🙂 |
There's an issue with this on Linux; the preinstall step errors out when executed:
We've reverted our yarn version to |
Looks like 1.22.10 works on Node.js 14, not 10 from what I test. |
Interesting, you may need to update npm. |
@benjie This parsing issue is unique to Yarn 2. Can you open a thread on our repository? |
@arcanis I'm not sure why I was @-d on this? Perhaps you meant to reply to a different issue? |
Sorry, I meant @bjentsch 😶 |
Will do @arcanis 👍 |
1.22.10 (and prior) Tweak the preinstall check to not cause errors when Node is installed as root (as a downside, it won't run at all on Windows, which should be an acceptable tradeoff): yarnpkg/yarn#8358 1.22.7 This release doesn't change anything and was caused by a publish issue. 1.22.6 Running yarn init with the -2 flag won't print the set version output anymore. A new preinstall check will ensure that npm install -g yarn works even under Corepack. It doesn't have any effect on other setups.
I'm having trouble parsing this. Does this mean Windows should still work if you don't install as admin? Or are you saying you're dropping support for Windows? |
The postinstall script simply won't have any effect. The rest of Yarn (ie, everything you care about) will work. |
This is still happening to me. Steps to reproduce:
Inside the container:
This will work:
|
I'm seeing this fail for docker ubuntu containers:
|
aws-lambda-nodejs have issue * [npm install -g yarn · Issue #6 · nodejs/corepack](nodejs/corepack#6) * [npm install yarn --global fails in docker container · Issue aws#8358 · yarnpkg/yarn](yarnpkg/yarn#8358) From issue comment, > For future reference, you can (should) pin your version rather than use whatever the latest is on npm (by using [email protected], etc) - it's a good practice anyway regardless of the conditions, as you never know which bug could slip by us. You can also use the yarn-path setting to ensure that upgrades go through the appropriate review processes (including CI). > > <yarnpkg/yarn#8358 (comment)> So we'll follow it. And from issue comment, > Fwiw we don't plan to add any more features to Yarn 1, as all of our resources have shifted to Yarn 2. The past few commits have been aimed toward making the transition a bit easier, in particular thanks to the Corepack initiative which we hope will make it easier to use Yarn (both 1 & 2) by removing the need to manually install them. > > <yarnpkg/yarn#8358 (comment)> There's not much need to be concerned with the latest version of 1.
This problem still persists. I have done RUN npm install -g npm still no luck |
nvm yarn was already installed in the based image |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [yarn](https://togithub.com/yarnpkg/yarn) | [`1.22.0` -> `1.22.22`](https://renovatebot.com/diffs/npm/yarn/1.22.0/1.22.22) | [![age](https://developer.mend.io/api/mc/badges/age/npm/yarn/1.22.22?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/yarn/1.22.22?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/yarn/1.22.0/1.22.22?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/yarn/1.22.0/1.22.22?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>yarnpkg/yarn (yarn)</summary> ### [`v1.22.22`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.22) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.21...v1.22.22) > \[!WARNING] > This release is missing a couple of artifacts (the .msi/.rpm/.deb/.asc files); we're working on fixing this. - Fixes a punycode warning. - Fixes a hoisting issue when transitive dependencies themselves listed aliases as dependencies. ### [`v1.22.21`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.21) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.20...v1.22.21) > \[!WARNING] > This release is missing a couple of artifacts (the .msi/.rpm/.deb/.asc files); we're working on fixing this. - Fixes an issue in the v1.22.20 when calling Yarn from a project subfolder, outside of a Corepack context. - Added a `SKIP_YARN_COREPACK_CHECK` environment variable to skip the Corepack check. ### [`v1.22.20`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.20) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.19...v1.22.20) - **Important:** Punycode is now embed within the bundle, as it has been deprecated by Node.js and will be removed in a future version. - A message will be displayed when Yarn 1.22 notices that the local project has a package.json file referencing a non-1.x Yarn release via the `packageManager` field. The message will explain that the project is intended to be used with [Corepack](https://nodejs.org/api/corepack.html). - The `yarn-error.log` files won't be generated anymore, as we don't process non-critical 1.x bug reports (we however process all bugs reported on https://github.com/yarnpkg/berry; we just released the 4.0.2 release there). - The `yarn set version x.y.z` command will now install the exact `x.y.z` version (prior to this change it used to first install the latest version, and only in a second step would it downgrade to `x.y.z`; this was causing issues when we bump the minimal Node.js version we support, as running `yarn set version 3.6.4` wouldn't work on Node 16). - Prevents crashes when reading from an empty `.yarnrc.yml` file. ### [`v1.22.19`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.19) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.18...v1.22.19) - Adds compatibility with WebAuthn on the npm registry ### [`v1.22.18`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.18) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.17...v1.22.18) Node 17.7.0 had a regression in `url.resolve` which broke Yarn, causing network errors. This release fixes that, although the regression also got fixed on the Node side starting from 17.7.1, so as long as you keep your Node up-to-date it'll be fine. ### [`v1.22.17`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.17) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.16...v1.22.17) Strangely this released disappeared from GitHub, re-adding it. ### [`v1.22.16`](https://togithub.com/yarnpkg/yarn/compare/v1.22.15...v1.22.16) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.15...v1.22.16) ### [`v1.22.15`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.15) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.14...v1.22.15) - Fixes an issue on Windows where relative scripts would fail to execute ### [`v1.22.14`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.14) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.13...v1.22.14) - Fixes false positives that would happen on non-win32 platforms ("Potentially dangerous call to ...") ### [`v1.22.13`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.13) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.12...v1.22.13) - Fixes a potential security issue where packages could run scripts even with `--ignore-builds` set (Windows only) - Fixes `yarn init -y2` w/ Corepack - `yarn set version stable` (and `canary`) will now defer to the stable & canary for upgrading the project ### [`v1.22.12`](https://togithub.com/yarnpkg/yarn/releases/tag/v1.22.12) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/1.22.11...v1.22.12) Bogus release (published the wrong folder) ### [`v1.22.11`](https://togithub.com/yarnpkg/yarn/blob/HEAD/CHANGELOG.md#12211) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/1.22.10...1.22.11) This version fixes a problem where Yarn wasn't forwarding SIGTERM to the binary spawned via `yarnPath`. It also makes `yarn init -2` compatible with [Corepack](https://togithub.com/nodejs/corepack). The behaviour of `yarn init` (without `-2`) doesn't change. Remember that Yarn 1.x won't receive further functional improvements. We recommend you to switch to the recently-released 3.0, and to ping us on Discord if you find issues when migrating (also check our [Migration Guide](https://yarnpkg.com/getting-started/migration#why-should-you-migrate)). ### [`v1.22.10`](https://togithub.com/yarnpkg/yarn/blob/HEAD/CHANGELOG.md#12210-and-prior) - Tweak the preinstall check to not cause errors when Node is installed as root (as a downside, it won't run at all on Windows, which should be an acceptable tradeoff): [https://github.com/yarnpkg/yarn/issues/8358](https://togithub.com/yarnpkg/yarn/issues/8358) ### [`v1.22.7`](https://togithub.com/yarnpkg/yarn/blob/HEAD/CHANGELOG.md#1227) This release doesn't change anything and was caused by a publish issue. ### [`v1.22.6`](https://togithub.com/yarnpkg/yarn/blob/HEAD/CHANGELOG.md#1226) - Running `yarn init` with the `-2` flag won't print the `set version` output anymore. - A new preinstall check will ensure that `npm install -g yarn` works even under [Corepack](https://togithub.com/arcanis/corepack). It doesn't have any effect on other setups. ### [`v1.22.5`](https://togithub.com/yarnpkg/yarn/blob/HEAD/CHANGELOG.md#1225) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.4...v1.22.5) - Headers won't be printed when calling `yarn init` with the `-2` flag [**Maël Nison**](https://twitter.com/arcanis) - Files with the `.cjs` extension will be spawned by `yarnPath` using \`execPath [#​8144](https://togithub.com/yarnpkg/yarn/pull/8144) - [**bgotink**](https://togithub.com/bgotink) - Generates local yarn verions as `.cjs` files when calling `yarn set version` [#​8145](https://togithub.com/yarnpkg/yarn/pull/8145) - [**bgotink**](https://togithub.com/bgotink) - Sorts files when running `yarn pack` to produce identical layout on Windows and Unix systems [#​8142](https://togithub.com/yarnpkg/yarn/pull/8142) - [**Merceyz**](https://togithub.com/merceyz) ### [`v1.22.4`](https://togithub.com/yarnpkg/yarn/blob/HEAD/CHANGELOG.md#1224--1223) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.1...v1.22.4) Those versions didn't contain any changes and were just triggered by our infra while working on the tests. ### [`v1.22.1`](https://togithub.com/yarnpkg/yarn/blob/HEAD/CHANGELOG.md#12211) [Compare Source](https://togithub.com/yarnpkg/yarn/compare/v1.22.0...v1.22.1) This version fixes a problem where Yarn wasn't forwarding SIGTERM to the binary spawned via `yarnPath`. It also makes `yarn init -2` compatible with [Corepack](https://togithub.com/nodejs/corepack). The behaviour of `yarn init` (without `-2`) doesn't change. Remember that Yarn 1.x won't receive further functional improvements. We recommend you to switch to the recently-released 3.0, and to ping us on Discord if you find issues when migrating (also check our [Migration Guide](https://yarnpkg.com/getting-started/migration#why-should-you-migrate)). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/rparini/cxroots-app). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNDUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI0NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Bug description
I've tried to install the latest yarn globally using lts/carbon npm.
It's failed with some permission denied message.
As I see the version which has been tried to install is not released: 1.22.7.
I haven't got problems with 1.22.5 but npm install yarn --global brakes our CI/CD pipeline.
The installation was tried in a docker container as root.
Command
What is the current behavior?
What is the expected behavior?
Steps to Reproduce
Environment
v8.17.0
6.13.4
1.22.7
Debian 10 in docker container
The text was updated successfully, but these errors were encountered: