question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tools assume `lerna` is installed globally

See original GitHub issue

Developers who don’t have lerna installed globally (i.e., via npm install --global lerna) are going to encounter errors with the build scripts:

exec: lerna: not found

One should be able to wrap most lerna invocations in scripts such as buildup and builddown with npx in order to resolve at least that issue, but overall, the directions in CONTRIBUTING should be reviewed to ensure the steps all work without any globally-installed npm packages.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
akkaashcommented, Dec 14, 2018

I guess the larger issue is around being able to use the versions of lerna and other tools from the npm dependencies as specified in the project package.json. It would be safe to use npx lerna and safer to replace occurrences of export PATH=node_modules/.bin:$PATH with export PATH=$(npm bin):$PATH (or add where not present) and then use the lerna (and others) as is since these binaries would be available in the path.

1reaction
mattmccleancommented, Jun 4, 2019

Am not sure this fixes the problem. Running the ./install.sh script no longer depends on having lerna installed globally but when running ../../../scripts/buildup in the package dir it complains that lerna: not found.

Taking a look at the node_modules/.bin dir at the project root level I see the lerna symlink exists whereas in the package dir the subfolder node_modules/.bin does not contain the lerna symlink.

Fix 1338 only adds the node_modules/.bin to PATH but if lerna is not installed then it will still not work. Perhaps the buildup script needs to also add ../../../node_modules/.bin to the PATH as it is the only place where lerna is installed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lerna NPM
Lerna is a tool that optimizes the workflow around managing multi-package repositories with git and ... Let's start by installing Lerna globally with...
Read more >
Setting up a monorepo with Lerna for a TypeScript project
Lerna is a popular and widely used tool written in JavaScript for setting and ... With this done, install Lerna as a global...
Read more >
Create a monorepo with Lerna | by Damian Cyrus
To use the lerna init command, you must first install the CLI globally or use npx. We will use the global installed CLI....
Read more >
@lerna/global-options | Yarn - Package Manager
readme. Important note: this project recently changed stewardship to Nrwl! Your favorite tool is alive and well: https://blog.
Read more >
Untitled
```sh $ npm install --global lerna ``` Next we'll create a new ... Lerna assumes the repo has already been initialized with `git...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found