Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm install fails with "sh: lerna: command not found" #1

Closed
awssandra opened this issue Oct 1, 2020 · 2 comments
Closed

Npm install fails with "sh: lerna: command not found" #1

awssandra opened this issue Oct 1, 2020 · 2 comments

Comments

@awssandra
Copy link
Contributor

awssandra commented Oct 1, 2020

Problem:
Npm install can be used directly on github branches, forks and commits, no need to publish to NPM central.

Reproduction (on fresh machine):
npm install open-o11y/aws-opentelemetry-js

Command line output:

~/aws-xray-sdk-node-sample [ npm install open-o11y/aws-opentelemetry-js                                            

> aws-opentelemetry-js@0.10.2 postinstall /Users/mcmuls/aws-xray-sdk-node-sample/node_modules/aws-opentelemetry-js
> npm run bootstrap


> aws-opentelemetry-js@0.10.2 bootstrap /Users/mcmuls/aws-xray-sdk-node-sample/node_modules/aws-opentelemetry-js
> lerna bootstrap

sh: lerna: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! aws-opentelemetry-js@0.10.2 bootstrap: `lerna bootstrap`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the aws-opentelemetry-js@0.10.2 bootstrap script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mcmuls/.npm/_logs/2020-09-29T20_56_26_255Z-debug.log
npm WARN aws-xray-sdk-express-sample@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aws-opentelemetry-js@0.10.2 postinstall: `npm run bootstrap`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the aws-opentelemetry-js@0.10.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mcmuls/.npm/_logs/2020-09-29T20_56_26_324Z-debug.log
~/aws-xray-sdk-node-sample [ nano /Users/mcmuls/.npm/_logs/2020-09-29T20_56_26_324Z-debug.log

NPM logs

88 verbose stack Error: aws-opentelemetry-js@0.10.2 postinstall: `npm run bootstrap`
88 verbose stack Exit status 1
88 verbose stack     at EventEmitter.<anonymous> (/Users/mcmuls/.nvm/versions/node/v11.15.0/lib/node_modules/npm/node_modules/npm-life$
88 verbose stack     at EventEmitter.emit (events.js:193:13)
88 verbose stack     at ChildProcess.<anonymous> (/Users/mcmuls/.nvm/versions/node/v11.15.0/lib/node_modules/npm/node_modules/npm-life$
88 verbose stack     at ChildProcess.emit (events.js:193:13)
88 verbose stack     at maybeClose (internal/child_process.js:999:16)
88 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
89 verbose pkgid aws-opentelemetry-js@0.10.2
90 verbose cwd /Users/mcmuls/aws-xray-sdk-node-sample
91 verbose Darwin 19.6.0
92 verbose argv "/Users/mcmuls/.nvm/versions/node/v11.15.0/bin/node" "/Users/mcmuls/.nvm/versions/node/v11.15.0/bin/npm" "install" "op$
93 verbose node v11.15.0
94 verbose npm  v6.7.0
95 error code ELIFECYCLE
96 error errno 1
97 error aws-opentelemetry-js@0.10.2 postinstall: `npm run bootstrap`
97 error Exit status 1
98 error Failed at the aws-opentelemetry-js@0.10.2 postinstall script.
98 error This is probably not a problem with npm. There is likely additional logging output above.
99 verbose exit [ 1, true ]
@awssandra
Copy link
Contributor Author

awssandra commented Oct 1, 2020

Figured it out, lerna is required to manage the top-level dependencies, because each of those are packages are to be published separately.

So, it looks like we can't npm install separate packages via Github for multi-package lerna repos.
Reading:
lerna/lerna#2074
lerna/lerna#1033

Not sure how we're addressing this from a customer-usage perspective, if we're planning on publishing to NPM for preview.

@KKelvinLo
Copy link
Contributor

As we published these packages separately and not the repository as a whole package; we don't encounter issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants