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 lerna publish is still broken #560

Closed
davereid opened this issue May 2, 2024 · 9 comments
Closed

yarn lerna publish is still broken #560

davereid opened this issue May 2, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@davereid
Copy link
Member

davereid commented May 2, 2024

This is a follow-up from #461 that things still don't seem to be working, or maybe I am missing something that needs to run?

➜  drainpipe git:(main) ✗ yarn install
➤ YN0065: Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry
➤ YN0065: Run yarn config set --home enableTelemetry 0 to disable

➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 819 packages were added to the project (+ 171.22 MiB).
➤ YN0000: └ Completed in 5s 401ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ nx@npm:18.2.4 [fa6ee] must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.20.2 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1s 261ms
➤ YN0000: · Done with warnings in 6s 926ms

➜  drainpipe git:(main) ✗ yarn learna publish
Usage Error: Couldn't find a script named "learna".

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...

My versions:

➜  drainpipe git:(main) ✗ yarn --version
4.1.1
➜  drainpipe git:(main) ✗ npm --version
10.5.0
➜  drainpipe git:(main) ✗ node --version
v20.12.2
@davereid davereid added the bug Something isn't working label May 2, 2024
@davereid
Copy link
Member Author

davereid commented May 2, 2024

When I fixed my spelling error, I still get this:

yarn lerna publish

node:internal/process/esm_loader:34
      internalBinding('errors').triggerUncaughtException(
                                ^
Error: Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.

Missing package: lerna@npm:8.1.2
Expected package location: /cache/others/berry/cache/lerna-npm-8.1.2-be48ad2329-10c0.zip/node_modules/lerna/

    at makeError (/home/davereid/code/drainpipe/.pnp.cjs:14832:34)
    at resolveUnqualified (/home/davereid/code/drainpipe/.pnp.cjs:16563:17)
    at resolveRequest (/home/davereid/code/drainpipe/.pnp.cjs:16614:14)
    at Object.resolveRequest (/home/davereid/code/drainpipe/.pnp.cjs:16670:26)
    at resolve$1 (file:///home/davereid/code/drainpipe/.pnp.loader.mjs:2005:21)
    at nextResolve (node:internal/modules/esm/hooks:866:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:304:30)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20)
    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)

Node.js v20.12.2

@davereid
Copy link
Member Author

davereid commented May 2, 2024

I also see a change to my local .pnp.cjs file whenever I run yarn install

@davereid davereid changed the title yarn learna publish is still broken yarn lerna publish is still broken May 2, 2024
@justafish
Copy link
Member

Can you try running just yarn? I was able to replicate this:

❯ yarn lerna --version

node:internal/process/esm_loader:34
      internalBinding('errors').triggerUncaughtException(
                                ^
Error: Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.

Missing package: lerna@npm:8.1.3
Expected package location: /cache/others/berry/cache/lerna-npm-8.1.3-48f9ae8498-10c0.zip/node_modules/lerna/

    at makeError (/home/justafish/repos/drainpipe/.pnp.cjs:14890:34)
    at resolveUnqualified (/home/justafish/repos/drainpipe/.pnp.cjs:16621:17)
    at resolveRequest (/home/justafish/repos/drainpipe/.pnp.cjs:16672:14)
    at Object.resolveRequest (/home/justafish/repos/drainpipe/.pnp.cjs:16728:26)
    at resolve$1 (file:///home/justafish/repos/drainpipe/.pnp.loader.mjs:2039:21)
    at nextResolve (node:internal/modules/esm/hooks:750:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:238:30)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:199:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)

Node.js v21.4.0
⏎                                                                                    
drainpipe on  238--phpcs-scaffold [$] via  v21.4.0 via 🐘 v8.2.15 took 2s 
❯ yarn
➤ YN0000: · Yarn 4.2.2
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 42 packages were added to the project (+ 64.02 MiB).
➤ YN0000: └ Completed in 2s 264ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ nx@npm:19.0.2 [231b4] must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.21.3 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1s 41ms
➤ YN0000: · Done with warnings in 3s 650ms

drainpipe on  238--phpcs-scaffold [$!] via  v21.4.0 via 🐘 v8.2.15 took 5s 
❯ yarn lerna --version
8.1.3

@justafish justafish self-assigned this May 22, 2024
@justafish justafish assigned davereid and unassigned justafish Jun 10, 2024
@mrdavidburns
Copy link
Member

mrdavidburns commented Jul 25, 2024

I believe I was able to replicate this on a client project w/ Drainpipe v3.8.1

ddev ssh
davidburns@[project-name]:/var/www/html$ yarn --version
3.8.3
davidburns@[project-name]:/var/www/html$ npm --version
10.7.0
davidburns@[project-name]:/var/www/html$ node --version
v20.15.0
davidburns@[project-name]:/var/www/html$ cd web/themes/custom/baker/
davidburns@[project-name]:/var/www/html/web/themes/custom/baker$ yarn install
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0069: │ nightwatch ➤ dependencies ➤ lodash: This rule seems redundant when applied on the original package; the extension may have been applied upstream.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ postcss@npm:8.4.40 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ stylelint-config-sass-guidelines@npm:11.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0019: │ @stylistic-stylelint-plugin-npm-2.1.2-b7bce530d4-31b68cdf1a.zip appears to be unused - removing
➤ YN0019: │ style-search-npm-0.1.0-e3177d3642-3cfefe3350.zip appears to be unused - removing
➤ YN0019: │ stylelint-config-sass-guidelines-npm-12.0.0-41dd2efa1e-e04307317e.zip appears to be unused - removing
➤ YN0000: └ Completed in 0s 280ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: Done with warnings in 0s 413ms
davidburns@[project-name]:/var/www/html/web/themes/custom/[theme-name]$ yarn lerna publish
Usage Error: Couldn't find a script named "lerna".

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...
ddev yarn install
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0069: │ nightwatch ➤ dependencies ➤ lodash: This rule seems redundant when applied on the original package; the extension may have been applied upstream.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0000: └ Completed
➤ YN0000: Done with warnings in 0s 205ms

ddev yarn lerna publish
Usage Error: Couldn't find a script named "lerna".

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...
ddev yarn --version
3.8.3

@mrdavidburns
Copy link
Member

Using the suggestion here I've enabled --trace-deprecations for node.

After doing that this is the error I'm getting.

yarn lerna publish --no-push
lerna notice cli v8.1.7
(node:59080) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:3:9
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:399:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
    at loadBuiltinModule (node:internal/modules/helpers:96:7)
    at Module._load (node:internal/modules/cjs/loader:1070:17)
    at require$$0.Module._load (/Users/davidburns/Sites/lullabot/drainpipe/.pnp.cjs:15085:31)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
    at Module.require (node:internal/modules/cjs/loader:1304:12)
    at require (node:internal/modules/helpers:123:16)
lerna info versioning independent

I'm not seeing any references to punycode in the codebase after running yarn install. But it does seem that there may be a deprecated dependency.

@mrdavidburns
Copy link
Member

mrdavidburns commented Aug 8, 2024

I was able to get yarn lerna publish --no-push to run without error by first running:

export NODE_OPTIONS="--no-deprecation"
yarn install
git add .pnp.cjs
git checkout -b 560--fix-lerna
git commit -m "Issue #560: Fixing Lerna"
yarn lerna publish --no-push

Here's the output:

yarn lerna publish --no-push
lerna notice cli v8.1.7
lerna info versioning independent
lerna info Looking for changed packages since @lullabot/drainpipe-javascript@0.0.4
lerna info getChangelogConfig Successfully resolved preset "conventional-changelog-angular"

Changes:
 - @lullabot/drainpipe-javascript: 0.0.4 => 0.0.5
 - @lullabot/drainpipe-sass: 0.1.2 => 0.1.3

? Are you sure you want to publish these packages? No

However, when I pushed up the branch it is showing no changes and won't let me create a pull request.
https://github.com/Lullabot/drainpipe/compare/560--fix-lerna?expand=1
image

Here are a few issues that lead me down this path:

@mrdavidburns
Copy link
Member

I'm going to re-test this now that Drainpipe has had a few new releases.

@mrdavidburns
Copy link
Member

Still not working on main branch.

ddev yarn lerna publish --no-push

node:internal/modules/run_main:129
    triggerUncaughtException(
    ^
Error: Qualified path resolution failed: we looked for the following paths, but none could be accessed.

Source path: /cache/others/berry/cache/lerna-npm-8.1.7-ee96f315eb-10c0.zip/node_modules/lerna/dist/cli.js
Not found: /cache/others/berry/cache/lerna-npm-8.1.7-ee96f315eb-10c0.zip/node_modules/lerna/dist/cli.js

    at makeError (/var/www/html/.pnp.cjs:14960:34)
    at resolveUnqualified (/var/www/html/.pnp.cjs:16692:13)
    at resolveRequest (/var/www/html/.pnp.cjs:16732:14)
    at Object.resolveRequest (/var/www/html/.pnp.cjs:16788:26)
    at resolve$1 (file:///var/www/html/.pnp.loader.mjs:2043:21)
    at nextResolve (node:internal/modules/esm/hooks:866:28)
    at Hooks.resolve (node:internal/modules/esm/hooks:304:30)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)
    at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)

Node.js v20.16.0
Failed to run yarn lerna publish --no-push: exit status 1

@justafish
Copy link
Member

I just published the packages no problem with node 20 and yarn 4.5.0. I've updated the readme instructions in #713

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants