Version 6.0.1 encountered execution issues when using Yarn v4 with the nodeLinker set to pnpm.
michael5107414 opened this issue · 2 comments
Hi isaacs,
I encountered the following error when executing yarn rimraf ${file_path}
node:fs:448
return binding.readFileUtf8(path, stringToFlags(options.flag));
^
Error: ENOENT: no such file or directory, open 'C:\Users\michael_dev\Projects\typescript-boilerplate\node_modules\.store\package.json'
at readFileSync (node:fs:448:20)
at loadPackageJson (file:///C:/Users/michael_dev/Projects/typescript-boilerplate/node_modules/.store/package-json-from-dist-npm-1.0.0-961f0fcb3b/package/dist/esm/index.js:118:86)
at file:///C:/Users/michael_dev/Projects/typescript-boilerplate/node_modules/.store/rimraf-npm-6.0.1-2d0b0aeb1b/package/dist/esm/bin.mjs:4:21
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5) {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Users\\michael_dev\\Projects\\typescript-boilerplate\\node_modules\\.store\\package.json'
}
Node.js v20.15.0
I discovered that the module package-json-from-dist-npm
incorrectly parses the package.json
file path when using Yarn v4 with nodeLinker set to pnpm
. Based on the structure of node_modules
, the correct path should be ${project_root}/node_modules/.store/rimraf-npm-6.0.1-2d0b0aeb1b/package/package.json
.
In version 6.0.0, this worked as expected, but in version 6.0.1, the changes seem to have introduced this issue. It may be worth adjusting the modifications made in version 6.0.1 to address this.
Maybe you can use something like package-up to replace package-json-from-dist?
This works fine when installed with pnpm and npm. I'm not that interested in debugging Yarn problems. If you want to reproduce the issue over on the package-json-from-dist
repo, and provide a patch there to fix it, that'd be lovely. But the only fix here would be "update that dep", so I'm going to close this.
Thanks.