question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`lerna run` choked on Node v14.17.5

See original GitHub issue

Describe the bug

Executing lerna run on Node v14.17.5 runtime of pnpm gave me:

➜  fiddle git:(pnpm) pnpm node -v
v14.17.5
➜  fiddle git:(pnpm) pnpm x

> root@ x /Users/i532660/github/fiddle
> lerna run x

internal/modules/cjs/loader.js:892
  throw err;
  ^

Error: Cannot find module 'node:fs'
Require stack:
- /Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+version@1.6.0/node_modules/@lerna-lite/version/dist/lib/update-lockfile-version.js
- /Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+version@1.6.0/node_modules/@lerna-lite/version/dist/lib/index.js
- /Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+version@1.6.0/node_modules/@lerna-lite/version/dist/index.js
- /Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+cli@1.6.0/node_modules/@lerna-lite/cli/dist/cli-commands/cli-version-commands.js
- /Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+cli@1.6.0/node_modules/@lerna-lite/cli/dist/cli-commands/cli-publish-commands.js
- /Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+cli@1.6.0/node_modules/@lerna-lite/cli/dist/lerna-entry.js
- /Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+cli@1.6.0/node_modules/@lerna-lite/cli/dist/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+version@1.6.0/node_modules/@lerna-lite/version/dist/lib/update-lockfile-version.js:10:19)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+version@1.6.0/node_modules/@lerna-lite/version/dist/lib/update-lockfile-version.js',
    '/Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+version@1.6.0/node_modules/@lerna-lite/version/dist/lib/index.js',
    '/Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+version@1.6.0/node_modules/@lerna-lite/version/dist/index.js',
    '/Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+cli@1.6.0/node_modules/@lerna-lite/cli/dist/cli-commands/cli-version-commands.js',
    '/Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+cli@1.6.0/node_modules/@lerna-lite/cli/dist/cli-commands/cli-publish-commands.js',
    '/Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+cli@1.6.0/node_modules/@lerna-lite/cli/dist/lerna-entry.js',
    '/Users/i532660/github/fiddle/node_modules/.pnpm/registry.npmjs.org+@lerna-lite+cli@1.6.0/node_modules/@lerna-lite/cli/dist/cli.js'
  ]
}
 ELIFECYCLE  Command failed with exit code 1.

Running on a higher version, e.g. v16.16.0, seemed to be fine.

Expectation

No response

Reproduction

Should be reproducible here: https://github.com/dwiyatci/fiddle/tree/pnpm

Simply run pnpm x 😃

Lerna config and logs

lerna.json

<!-- Please paste your `lerna.json` here -->

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Environment Info

Environment info:

  System:
    OS: macOS 12.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 14.17.5 - ~/Library/pnpm/node
    Yarn: 1.19.1 - ~/.volta/bin/yarn
    npm: 6.14.14 - ~/Library/pnpm/npm
  Utilities:
    Git: 2.32.1 - /usr/bin/git

Used Package Manager

pnpm

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dwiyatcicommented, Jul 21, 2022

@ghiscoding Thanks again, very much, for the effort! It works wonderfully, and we’re now back in business in migrating to pnpm + lerna-lite!! ❤️

(and never mind the v1.7.0 mistake, it’s just life, I guess… 😅 )

2reactions
ghiscodingcommented, Jul 21, 2022

this should be fixed in the latest release v1.8.0 (note that I skipped v1.7.0 by mistake)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Orphaned child processes keep running when exiting `lerna ...
I'm running the command lerna run --stream --parallel start and if ... the other app exits is causing the node.exe process to be...
Read more >
Unable to run lerna's command - node.js - Stack Overflow
In my case, I just run sudo npm install --g lerna , and it works after bootstrap.
Read more >
npm run bootstrap succeeds but npm run start fails (solved)
After bootstrap is finished, you should be able to run npm run start and see Compass application running locally. Any tips, please?
Read more >
@lerna/run - npm
Run an npm script in each package that contains that script. Latest version: 6.2.0, last published: 11 days ago. Start using @lerna/run in ......
Read more >
Getting Started | Lerna
When running lerna init , Lerna configures the workspace to use NPM/YARN/PNPM workspaces, the built-in solution for local referencing of packages.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found