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
when using rush over yarn, adding packages doesn't work unless you purge and update after. (On my linux machine, purging doesn't seem to be necessary but it is on my windows machine).
With rush over pnpm, when you run cd packages/myproject && rush add -p some-package, the package is added to your package.json the relevant lockfile, installed, and linked from the merged package's node_modules to your project's node_modules.
With yarn, it is only added to the package.json. A rush update occurs which reports the following warning:
The shrinkwrap file (yarn.lock) contains the following issues:
Missing dependency "lodash.pick" (~4.4.0) required by "proj1"
It is not installed or linked, and the lockfile isn't updated. After some testing, running rush update --full successfully installs and links the package after, but on non-toy projects you don't always want to update all dependencies just to install a new one.
It may be important to note that I can't use pnpm in my monorepo because I produce an electron app, and electron's utilities often don't follow links and assume a naive node_modules layout. Until that is fixed, you have to use npm or yarn.
Repro steps
Here is an mvr repo I prepared, check it out and run the repro.sh script after reading it, and you can run the reset.sh script if necessary to restore the repo state. I have reproduced its contents and important output below so you can see it
Output (excluding rush's output, just the repo state that repro.sh prints to stdout)
LINKED MODULES
node_modules
node_modules/lazy-from
ALL MODULES
../../common/temp/node_modules
../../common/temp/node_modules/@rush-temp
../../common/temp/node_modules/.yarn-integrity
../../common/temp/node_modules/lazy-from
PACKAGE.JSON
{
"name": "proj1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"lazy-from": "~1.1.1",
"lodash.pick": "~4.4.0"
}
}
YARN.LOCK
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.# yarn lockfile v1"@rush-temp/proj1@file:./projects/proj1.tgz":
version "0.0.0"
resolved "file:./projects/proj1.tgz#d12365c6ba1a4ab080edcc54c46602e10fff4f75"
dependencies:
lazy-from "~1.1.1"
lazy-from@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/lazy-from/-/lazy-from-1.1.1.tgz#eac9e06dbdf8a31332ec993ff211dfcec509fd42"
integrity sha512-IC8L8XNTRncqodcjXNMML4u4T6kR/ATCotbss5ymYzDtb8RRYxTaxHM0ZDzyYavAkHhY8vLNxL4RKcaXPcTFRQ==
Fixup command behavior:
after testing the mvr on windows on the latest rush+yarn versions as I did on linux, they appeared to have the exact same behavior.
command ran after rush add
effects
rush update
lockfile is updated, package installed to common/temp/node_modules but not linked in proj1
rush update && rush link
lockfile is updated, package installed to common/temp/node_modules but not linked in proj1
rush update --full
successfully installs and links package
On an older version of rush on windows, I would have to run rush purge && rm -f common/config/rush/yarn.lock && rush update
Standard questions
Question
Answer
@microsoft/rush globally installed version?
5.54.0
rushVersion from rush.json?
5.54.0
yarnVersion from rush.json?
1.22.11
useWorkspaces from rush.json?
No
Operating system?
Linux/Windows
Would you consider contributing a PR?
Yes
Node.js version (node -v)?
12.18.4
The text was updated successfully, but these errors were encountered:
Probably related to #1748 , would be great if this got fixed, makes using yarn very slow, having to do a full purge and update just to update a single package.
Summary
when using rush over yarn, adding packages doesn't work unless you
purge andupdate after. (On my linux machine, purging doesn't seem to be necessary but it is on my windows machine).With rush over pnpm, when you run
cd packages/myproject && rush add -p some-package
, the package is added to yourpackage.json
the relevant lockfile, installed, and linked from the merged package'snode_modules
to your project'snode_modules
.With yarn, it is only added to the
package.json
. A rush update occurs which reports the following warning:It is not installed or linked, and the lockfile isn't updated. After some testing, running
rush update --full
successfully installs and links the package after, but on non-toy projects you don't always want to update all dependencies just to install a new one.It may be important to note that I can't use pnpm in my monorepo because I produce an electron app, and electron's utilities often don't follow links and assume a naive
node_modules
layout. Until that is fixed, you have to use npm or yarn.Repro steps
Here is an mvr repo I prepared, check it out and run the
repro.sh
script after reading it, and you can run thereset.sh
script if necessary to restore the repo state. I have reproduced its contents and important output below so you can see itOutput (excluding rush's output, just the repo state that
repro.sh
prints to stdout)Fixup command behavior:
after testing the mvr on windows on the latest rush+yarn versions as I did on linux, they appeared to have the exact same behavior.
rush add
rush update
rush update && rush link
rush update --full
On an older version of rush on windows, I would have to run
rush purge && rm -f common/config/rush/yarn.lock && rush update
Standard questions
@microsoft/rush
globally installed version?rushVersion
from rush.json?yarnVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?The text was updated successfully, but these errors were encountered: