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

installing @neume-network/core fails because of husky or missing .git repository #84

Open
TimDaub opened this issue Sep 2, 2022 · 2 comments

Comments

@TimDaub
Copy link
Collaborator

TimDaub commented Sep 2, 2022

 timdaub@kazoo  ~/Projects/neume-network/blueprints   main  npm i @neume-network/core

> @neume-network/[email protected] postinstall /Users/timdaub/Projects/neume-network/blueprints/node_modules/@neume-network/core
> git submodule sync && git submodule update --init && cd ./src/strategies && npm install


> [email protected] prepare /Users/timdaub/Projects/neume-network/blueprints/node_modules/@neume-network/core/src/strategies
> husky install

.git can't be found (see https://git.io/Jc3F9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepare: `husky install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepare 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/timdaub/.npm/_logs/2022-09-02T13_50_55_489Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @neume-network/[email protected] postinstall: `git submodule sync && git submodule update --init && cd ./src/strategies && npm install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @neume-network/[email protected] 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/timdaub/.npm/_logs/2022-09-02T13_50_56_323Z-debug.log
@il3ven
Copy link
Contributor

il3ven commented Oct 15, 2022

@TimDaub We should remove git commands from postinstall script. As a dev I always manually update strategies to whichever branch I am working on. For the users we can add it in the readme to use git clone --recurse-submodules.

The new postinstall script will be:

"postinstall": "cd ./src/strategies && npm install",

The above will solve our problem but in case you want to keep the git commands, we can add an if condition in postinstall to only sync submodule if it is a git repo. In case of npm i @neume-network/core it isn't a git repo and so we see the original error.

postinstall script in case we use an if:

"postinstall": "if git rev-parse --git-dir > /dev/null 2>&1; then git submodule sync && git submodule update --init; fi; cd ./src/strategies && npm install",

@TimDaub
Copy link
Collaborator Author

TimDaub commented Oct 19, 2022

For the users we can add it in the readme to use git clone --recurse-submodules.

The new postinstall script will be:

"postinstall": "cd ./src/strategies && npm install",

ok sounds good

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