Open CluEleSsUK opened 2 days ago
I'm not entirely sure what's going on here.
In moon, yarn-deduplicate
is ran through npx and doesn't rely on PATH
. But it does look like it's actually hitting the correct path though? /Users/me/.nvm/versions/node/v22.3.0/lib/node_modules/yarn-deduplicate/dist/cli.js
.
I'm guessing it's failing here? https://github.com/scinos/yarn-deduplicate/blob/master/src/cli.ts#L65
Is there a lockfile? Where is it located?
indeed I can even open /Users/me/.nvm/versions/node/v22.3.0/lib/node_modules/yarn-deduplicate/dist/cli.js
.
There is a lockfile in the myproject
dir but not myrepo
(which is the root)
though the fact it's looking for the file yarn-deduplicate
in that directory and not yarn.lock
seems suspicious
I suspect the first arg here isn't necessary: https://github.com/moonrepo/moon/blame/9d4e5dc0b87dd8b741448c46de84495dd94e378e/legacy/node/tool/src/yarn_tool.rs#L218
though seems like it's been round a long time to have been broken without reporting
Unless npx changed how it's args work, that basically becomes: npx yarn-deduplicate yarn.lock
.
I think the problem though that this may be running in the workspace root and not the project root. Let me dig further.
For now you can disable this till it works: https://moonrepo.dev/docs/config/toolchain#dedupeonlockfilechange
I created a package.json at the root and created a yarn.lock but to no avail. Will disable for now - thanks!
Hmm suspiciously it's still attempting to dedupe with the flag in my toolchain.yml
EDIT: npm seems to work fwiw
I'm looking into this and haven't seen anything weird.
yarn.lock
exists: https://github.com/moonrepo/moon/blob/master/legacy/node/tool/src/yarn_tool.rs#L215dedupeOnLockfileChange
conditional should work (it's the same for all tools): https://github.com/moonrepo/moon/blob/master/legacy/node/platform/src/actions/install_deps.rs#L56What's your npx version? I noticed you're using node v22, which is newer. Let me see if the APIs changed.
Seems like npx has changed a bit since this was first built. Trying this: https://github.com/moonrepo/moon/pull/1701
Describe the bug
Running a simple
moon project:build
throws an error aboutyarn-deduplicate
not existing from insideyarn-deduplicate
's code itself.Steps to reproduce
my toolchain.yml is as follows:
my moon.yml for the project is as follows:
The following is the build output:
Expected behavior
my
yarn build
to run successfully (as it does when run on its own)Environment
Additional context
I have tried both fish and bash, and
language: 'javascript'