You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding a local dependency requires deleting the npm-shrinkwrap.json file and re-running rush update. Probably a duplicate of #2928, except the problem is with npm and not yarn, but I thought perhaps best to have a separate issue for npm?
This is definitely an issue with rush update, as described by @octogonz in #886.
He describes a workaround for NPM6 as "deleting the node_modules folder and lockfile". My attempt at that approach in this branch still has some issues:
✅ rush add -p XYZ works as expected
✅ Add a dependency manually to package.json and run rush update works as expected
✅ Edit a dependency version manually and run rush update works as expected
❌ Remove a dependency manually from package.json and run rush update does not work (the symlink is still left in the node_modules folder in your project). Need to rush update --full to fully remove.
❌ Cannot rush add -p LOCAL_PROJECT (in this case, rush add -p leaf-package), or manually add it and run rush update -- still need to run rush update --full to get the symlink to show up in node_modules.
Ideally, we could come up with some tricks that wouldn't require a fullUpgrade on every package edit with NPM, but so far I haven't had any luck with half-measures.
Summary
Adding a local dependency requires deleting the
npm-shrinkwrap.json
file and re-runningrush update
. Probably a duplicate of #2928, except the problem is with npm and not yarn, but I thought perhaps best to have a separate issue for npm?Repro steps
I have created a repository here: https://github.com/nzjony/rush-add-package-dependency-issue
Simply:
To reproduce the bug
git clone
the reporush update
cd packages/trunk-package
rush add -p leaf-package
rush build
<- Will fail, because the index.ts tries to access an exported function from leaf-package which wasn't correctly added.Work around:
rm common/config/rush/npm-shrinkwrap.json
rush update && rush build
Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?The text was updated successfully, but these errors were encountered: