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
fix(arborist): node.target
can be null
#7065
base: latest
Are you sure you want to change the base?
Conversation
Followup to npm#7027
a node 16 test failed but since node 16 isn't supported anymore, i assume those tests can be dropped (and node 21 added)? |
b261403
to
d6826f1
Compare
ba5978b
to
ba53945
Compare
I am still planning to add a failing test case for this in smoke-tests, but I do think this fix looks good. |
Thanks! I'm looking forward to it landing and being unblocked, and if there's anything concrete I can do to hurry it along I'd love pointers. |
I am getting a related
Using arborist@7.3.1 in node@v21.6.2 for a package with some dependencies as file: symlinks (with some being inter-dependent). Stacktrace: at [addToBuildSet] (/Users/myname/my-package/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:270:22)
at [buildQueues] (/Users/myname/my-package/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:210:41)
at [build] (/Users/myname/my-package/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:182:29)
at Arborist.rebuild (/Users/myname/my-package/node_modules/@npmcli/arborist/lib/arborist/rebuild.js:100:25)
at async [reifyPackages] (/Users/myname/my-package/node_modules/@npmcli/arborist/lib/arborist/reify.js:252:11)
at async Arborist.reify (/Users/myname/my-package/node_modules/@npmcli/arborist/lib/arborist/reify.js:171:5) |
@dmnsgn That looks like a different bug. Can you open a new issue about it including your package.json with the interdependent symlinks? |
Sorry, I am having a hard time making a reduced case but a clue for solving the issue is removing a leftover npm info using npm@10.2.4
npm info using node@v21.6.2
// ...
npm verb stack TypeError: Cannot read properties of undefined (reading 'target')
npm verb stack at Query.execWorkspaces (/usr/local/lib/node_modules/npm/lib/commands/query.js:104:33)
npm verb stack at async module.exports (/usr/local/lib/node_modules/npm/lib/cli-entry.js:61:5) Not sure it is worth opening an issue if I can't provide repro easily but maybe the above might help someone or "leftover package-lock" might ring a bell to someone who's worked on this. |
Another clue is: one of the workspace was dependent on another workspace but its dependency version was different. Example:
That solves it for me so I'll stop here and open another issue if I encounter these errors again. Hope that helps someone. |
Followup to #7027. Fixes #6815.
Fixes this issue: https://github.com/ljharb/list-exports/actions/runs/7537180864/job/20515721981