Closed rphovley closed 3 weeks ago
Might have something to do with:
https://github.com/npm/cli/issues/4064#issuecomment-1142426287 https://github.com/npm/cli/issues/3847
EDIT: These are old but also seem to hint at setting symlinks correctly
Some deeper looks seem to indicate that this file symlink is not working on the global install
24 verbose stack TypeError: Cannot set properties of null (setting 'dev')
24 verbose stack at calcDepFlagsStep (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/calc-dep-flags.js:34:21)
The issue occurs in this code
if (node.isLink) {
node.target.dev = node.dev // node.target is null
node.target.optional = node.optional
node.target.devOptional = node.devOptional
node.target.peer = node.peer
return calcDepFlagsStep(node.target)
}
This PR has some cleanup that makes better use of workspaces, but the end result has been the same with it that the internal file dependencies aren't working https://github.com/CodeClimbersIO/cli/pull/176/files
Also, made a stackoverflow to see if we get any bites: Edits welcome https://stackoverflow.com/questions/78877405/title-npm-global-install-fails-for-monorepo-with-workspace-dependencies
And a minimally reproducable simple repo https://github.com/rphovley/publishing-workspaces-test
Replication Steps:
npm i -g codeclimbers
current workaround is to update npm (
npm i -g npm
) and rerunnpm i -g codeclimbers
. For reasons I haven't uncovered yet, this solves the issue (changelog between npm 10.8.1 and 10.8.2 don't have anything that seems relevant to the error)Full Stack Trace: