Uh oh!
There was an error while loading. Please reload this page.
fix(arborist): node.target can be null - #7065
Conversation
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
d6826f1Compareba5978b to
ba53945Comparelukekarrys
commented
Feb 2, 2024
I am still planning to add a failing test case for this in smoke-tests, but I do think this fix looks good. |
ljharb
commented
Feb 2, 2024
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) |
lukekarrys
commented
Feb 22, 2024
@dmnsgn That looks like a different bug. Can you open a new issue about it including your package.json with the interdependent symlinks? |
dmnsgn
commented
Feb 27, 2024
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.4npm 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. |
dmnsgn
commented
Apr 11, 2024
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. |
I am getting an error about the target being null but this PR did not fix it |
…#7579) <!-- What / Why --> If a node represents a symbolic link or a file dep (node.isLink is true), its target is expected to reference another node in the dependency tree. If the linking is not done correctly or is incomplete, node.target might be null. <!-- Describe the request in detail. What it does and why it's being changed. --> in this PR, a null check is added to ensure node.target is not null or before proceeding, which will prevent causing errors like: `npm error Cannot set properties of null (setting 'peer')` ## References Related to #7065, Fixes#6622, #5007, Closes#6622, #5007
owlstronaut
commented
Apr 15, 2025
Looks like this was resolved here #7579 |
Followup to #7027. Fixes#6815.
Fixes this issue: https://github.com/ljharb/list-exports/actions/runs/7537180864/job/20515721981