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
One of the packages in my monorepo has a dev script that runs a dev server. It's supposed to be an example that shows how to use libraries published from monorepo. When launch that dev script using lerna run --scope <pkg-name>, it works fine. But after publishing that package to npm registry, I tried using those libraries from a totally independent repo and same dev script failed with errors. Then I went back to the monorepo and ran npm run dev -w <pkg-name> from there - it failed with the same error.
So a question is - what does lerna run do differently? From my limited and wrong understanding, if the scope is specified as single package there's lerna run and npm run -w might as well be equivalent. I could just use npm run for this case, but it seems useful to understand this, if I'm going to use lerna further. Docs on lerna run do not seem to mention anything. Maybe I should read the code, but felt like constructing this question first. Answer would be appreciated. Let me know if you need more details about the error.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
One of the packages in my monorepo has a
devscript that runs a dev server. It's supposed to be an example that shows how to use libraries published from monorepo. When launch thatdevscript usinglerna run --scope <pkg-name>, it works fine. But after publishing that package to npm registry, I tried using those libraries from a totally independent repo and samedevscript failed with errors. Then I went back to the monorepo and rannpm run dev -w <pkg-name>from there - it failed with the same error.So a question is - what does
lerna rundo differently? From my limited and wrong understanding, if the scope is specified as single package there'slerna runandnpm run -wmight as well be equivalent. I could just usenpm runfor this case, but it seems useful to understand this, if I'm going to use lerna further. Docs on lerna run do not seem to mention anything. Maybe I should read the code, but felt like constructing this question first. Answer would be appreciated. Let me know if you need more details about the error.Beta Was this translation helpful? Give feedback.
All reactions