Skip to content
Advertisement

How to upgrade node module of the lerna’s subpackage

I started using lerna to be able to install all node modules for all sub packages using a single command. At the moment I do not use any other lerna features except lerna bootstrap. My lerna.json:

JavaScript

my root package.json:

JavaScript

my package-a‘s package.json:

JavaScript

my package-b‘s package.json:

JavaScript

i want to upgrade moment in the package-b. if i run yarn upgrade moment --latest in the package-b folder i got the following error:

JavaScript

if i run npx lerna --scope package-b exec -- "yarn upgrade moment --latest" in the root folder i get the following error:

JavaScript

How should I properly upgrade node module in the lerna’s sub-package?

Advertisement

Answer

Because both of your packages are private the npm repository can’t find them during the upgrade of the moment library. Also the lerna package is currently largely unmaintained.

There exists a workaround. Temporally delete the "package-a": "1.0.0", line from your package-b.json file.

Updated package-b/package.json file:

JavaScript

Now run:

JavaScript

Then put the "package-a": "1.0.0", line back to your package-b.json file.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement