-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Hi,
I've upgraded from Lerna 2 to 3.
Issue 1 - while bootstrap --hoist is good in principle I found many newer npm commands (outdated, audit) won't work. In addition, with --hoist no package-lock.json is created in each folder - which is surely detrimental when it comes to publishing packages that have dependencies (non dev)? One option is to remove semver but I'd prefer to wipe all package-lock.json files to update to minor/patch dependency revisions.
Issue 2 - the new lerna link command is not well explained, especially lerna link convert. Rather than hoisting I've used this command and I can see file:// references within each package.json. Dilemma is when published these locations won't point to them. Does lerna swap them out before publish?
The good news is without --hoist the package-lock.json's return.
Issue 3
Since all the devDependencies have moved to the root (which I agree with since I have several packages all using the same devDeps) I can no longer work directly in an individual folder. For example if I dive into package/x and do npm test and within the script->test is "mocha" then mocha will no longer be found. I guess it's because npm tries the node_modules/.bin folder but doesn't traverse through parent folders (possibly a bug of npm imo). Indeed if I switch the mocha command to be ../../node_modules/.bin/mocha it will work. Thing is, I have a lot of commands (babel, documentation, flow) in a lot of packages and it doesn't feel clean. Finally I tried npx mocha - worse as it attempts to install mocha into the current directory.
I'm not saying it's a bug of lerna, indeed lerna run is working correctly but I do feel lerna link convert should be documented. There are times when I don't want to use lerna run and --scope to run a command, such as when running an individual test within a package.
Thanks,
Andrew