lerna: Bootstrap with yarn fails (the first time) when run as an npm script
Running the following command as an npm script:
lerna bootstrap --hoist --loglevel=silly --nohoist='{joi,webpack}'"
I get the following error:
NpmUtilities.installInDir (".", ["babel-plugin-external-helpers@6.22.0","babel-preset-es2015@6.18.0","babel-preset-stage-2@6.18...)
Command exited with status 1: npm install
Errored while running BootstrapCommand.execute
Command exited with status 1: npm install
The log files are unhelpful. They basically just say that some error occurred when installing hoisted dependencies to the root as well as the non-hoisted dependencies to the various package directories.
I don’t get this error the second time I run the command or if I don’t run it as an npm script.
Do the lerna commands need to be executed by the global lerna CLI tool?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 5
- Comments: 29 (9 by maintainers)
just an update… because of this issue ive had to abandon using yarn with lerna all together… Hoping this can be resolved
Any update on this issue?
@noherczeg interesting- I only see this when running on CircleCI, which is Dockerized. I’m guessing this has something to do with the issue.
This is also going on in our case, but only in a Dockerized container where the user is
root. Could that have anything to do with this?Seems to be related when
yarn installin a particular package produces warnings. Is that intended @evocateur?@hulkish any luck? I seem to be having the same issue as you 😕
@medunham this hits close to home, ill give it a shot and report back, thanks!
This may be related.
I have a command like
"bootstrap": "lerna bootstrap"in mypackage.jsonat the root of the project and when I runnpm run lernafrom the command line I get similar errors with packages that have private scopes and custom.npmrcfiles inpackages/some-project/.npmrc.If I manually hoist the
.npmrcfile frompackages/some-project/.npmrcto the root of the project, thenpm run bootstrapthen succeeds.If I run the globally installed
lerna boostrapcommand, I get the same error unless I hoist the.npmrcfile manually.If I rollback from
2.0.0-beta.37to2.0.0-beta.36without the hoisted.npmrcthelerna bootstrapcommand still fails so it doesn’t seem to be something introduced from.36to.37.