You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use of corepack "packageManager" breaks npm run local-registry start #4024
Starting Local Registry
error This project's package.json defines "packageManager": "yarn@[email protected]". However the current global version of Yarn is 1.22.22.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
Expected Behavior
The local registry should start listening on port 4873.
This is a regression. An addition was made to package.json recently in which "packageManager" was added.
Removing the "packageManager" field is a workaround.
Starting Local Registry
error This project's package.json defines "packageManager": "yarn@[email protected]". However the current global version of Yarn is 1.22.22.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
Removing the "packageManager" property allows the registry to start and run...
Starting Local Registry
yarn run v1.22.22
$ /home/david/Development/lerna/node_modules/.bin/verdaccio --config ./.verdaccio/config.yml
(node:22646) [VERWAR002] VerdaccioWarning: The configuration property "logs" has been deprecated, please rename to "log" for future compatibility
(Use node --trace-warnings ... to show where the warning was created)
info --- config file - /home/david/Development/lerna/.verdaccio/config.yml
info --- the "crypt" algorithm is deprecated consider switch to "bcrypt" in the configuration file. Read the documentation for additional details
info --- using htpasswd file: /home/david/Development/lerna/.verdaccio/htpasswd
info --- plugin successfully loaded: verdaccio-htpasswd
warn --- http address - http://localhost:4873/ - verdaccio/5.31.1
I have verified that the issue was caused by a global version of yarn that was preventing volta from pinning the version of yarn to "1.22.19". In fact, the issue can be reproduced by changing the version of yarn to "1.22.22".
Closing the issue as an environment setup error.
Activity
JamesHenry commentedon Jun 24, 2024
Is
yarn@[email protected]a typo?We do use corepack in github workflows, so that's why we need the packageManager field.
I cannot reproduce any issue with starting the registry locally I'm afraid.
Please can you dig a little deeper into your environment and what might be causing it?
Here is my
lerna infooutput for you to compare as a starting point:geometryzen commentedon Jun 25, 2024
And here is mine...
Environment info:
System:
OS: Linux 6.8 Ubuntu 24.04 LTS 24.04 LTS (Noble Numbat)
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
Yarn: 1.22.22 - ~/.yarn/bin/yarn
npm: 10.8.1 - ~/.nvm/versions/node/v20.12.2/bin/npm
Utilities:
Git: 2.43.0 - /usr/bin/git
npmPackages:
lerna: file:packages/lerna => 8.1.5
geometryzen commentedon Jun 25, 2024
I've just pulled your recent changes on main onto a clean lerna codebase (meaning none of my changes).
As before, when I run...
npm run local-registry start
I get the following:
Starting Local Registry
error This project's package.json defines "packageManager": "yarn@[email protected]". However the current global version of Yarn is 1.22.22.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
The first few line of package.json are
{
"name": "lerna-monorepo",
"private": true,
"description": "lerna dog-fooding lerna",
"workspaces": [
"packages/*",
"packages/legacy-structure/commands/create"
],
"volta": {
"node": "20.14.0",
"yarn": "1.22.19",
"npm": "10.7.0"
},
"packageManager": "[email protected]",
"engines": {
Removing the "packageManager" property allows the registry to start and run...
Starting Local Registry
yarn run v1.22.22
$ /home/david/Development/lerna/node_modules/.bin/verdaccio --config ./.verdaccio/config.yml
(node:22646) [VERWAR002] VerdaccioWarning: The configuration property "logs" has been deprecated, please rename to "log" for future compatibility
(Use
node --trace-warnings ...to show where the warning was created)info --- config file - /home/david/Development/lerna/.verdaccio/config.yml
info --- the "crypt" algorithm is deprecated consider switch to "bcrypt" in the configuration file. Read the documentation for additional details
info --- using htpasswd file: /home/david/Development/lerna/.verdaccio/htpasswd
info --- plugin successfully loaded: verdaccio-htpasswd
warn --- http address - http://localhost:4873/ - verdaccio/5.31.1
I'll do some digging here.
geometryzen commentedon Jun 25, 2024
I've just found this...
yarnpkg/yarn#9015
I don't think volta is doing it's job on my system.
geometryzen commentedon Jun 25, 2024
I have verified that the issue was caused by a global version of yarn that was preventing volta from pinning the version of yarn to "1.22.19". In fact, the issue can be reproduced by changing the version of yarn to "1.22.22".
Closing the issue as an environment setup error.