Closed 666asd closed 7 months ago
Looks like this was introduced in the release this morning; 1.22.20
Facing the same issues ever since 1.22.20.
We fixed it by currently pinning our version to 1.22.19
via npm install -g yarn@1.22.19
for us what fixed it was removing a --cwd
option
Looks like this was introduced in the release this morning; 1.22.20
Confirming that this has also broken our pipeline due to --cwd
flag no longer working. Also will be pinning to 1.22.19 for the time being.
Here's a repro Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:6.0-bookworm-slim AS build
# install node and npm
# replace shell with bash so we can source files
RUN curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.39.1/install.sh | sh
ENV NODE_VERSION 20.5.1
ENV NVM_DIR /root/.nvm
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
RUN . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm use $NODE_VERSION \
&& npx --yes yarn add svg-to-ico@1.0.14 svg2img@1.0.0-beta.2
Adding @1.22.19
to the yarn spec works fine
I'm investigating. It seems the problem is triggered when calling Yarn through npx
, as this fails:
cd $(mktemp -d) && yarn init -y && yarn install && mkdir foo && cd foo && npx yarn install
Whereas this works:
cd $(mktemp -d) && yarn init -y && yarn install && mkdir foo && cd foo && yarn install
If this helps I'm facing the same issue, commands (Node version v18.16.0, npm version 9.5.1, macOS Sonoma 14.1.1)
npm install -g yarn
yarn set version 1
Result in
Error: Couldn't find a package.json file in "/Users/<username>/test"
at /Users/<username>/test/.yarn/releases/yarn-1.22.20.cjs:43530:15
at Generator.next (<anonymous>)
at step (/Users/<username>/test/.yarn/releases/yarn-1.22.20.cjs:310:30)
at /Users/<username>/test/.yarn/releases/yarn-1.22.20.cjs:321:13
This was fixed by pinning the yarn version to 1.22.19 as mentioned by @PhilippMeissner
I have identified a fix; I'm working on releasing it
I released the 1.22.21 which should have fixed this; can one of you confirm me that it looks good on your side?
I've confirmed this patch resolved my issue.
Fixed for me as well, thank you for the prompt fix 👍
npm ls -g yarn
npm WARN config global
--global
,--local
are deprecated. Use--location=global
instead. /opt/node/lib └── yarn@1.22.20yarn --help
Error: Couldn't find a package.json file in "/" at MessageError.ExtendableBuiltin (/opt/node/lib/node_modules/yarn/lib/cli.js:721:66) at new MessageError (/opt/node/lib/node_modules/yarn/lib/cli.js:750:123) at /opt/node/lib/node_modules/yarn/lib/cli.js:41356:15 at Generator.next ()
at step (/opt/node/lib/node_modules/yarn/lib/cli.js:310:30)
at /opt/node/lib/node_modules/yarn/lib/cli.js:321:13