Skip to content

npm install fails with husky: command not found #1911

@hwride

Description

@hwride

Q&A (please complete the following information)

  • OS: macOS Catalina v10.15.7
  • Environment: npm v6.14.10
  • Method of installation: npm
  • Swagger-Client version: 3.13.0
  • Swagger/OpenAPI version:

Content & configuration

A blank folder with an empty package.json.

Describe the bug you're encountering

When running npm i swagger-ui-react it fails when trying to perform the postinstall for swagger-client.

To reproduce...

Steps to reproduce the behavior:

  1. Create a folder with a new package.json file.
  2. Run npm i swagger-ui-react

Expected behavior

swagger-ui-react installs successfully.

Actual behaviour

$ npm i swagger-ui-react
npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

> core-js@2.6.12 postinstall /Users/aaa/repos/node-test/test/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js-pure@3.8.3 postinstall /Users/aaa/repos/node-test/test/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"


> swagger-client@3.13.0 postinstall /Users/aaa/repos/node-test/test/node_modules/swagger-client
> husky install

sh: husky: command not found
npm WARN swagger-ui-react@3.42.0 requires a peer of react@>=15.6.2 but none is installed. You must install peer dependencies yourself.
npm WARN swagger-ui-react@3.42.0 requires a peer of react-dom@>=15.6.2 but none is installed. You must install peer dependencies yourself.
npm WARN react-copy-to-clipboard@5.0.3 requires a peer of react@^15.3.0 || ^16.0.0 || ^17.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-redux@4.4.10 requires a peer of react@^0.14.0 || ^15.0.0-0 || ^15.4.0-0 || ^16.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN react-inspector@2.3.1 requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-motion@0.5.2 requires a peer of react@^0.14.9 || ^15.3.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-debounce-input@3.2.3 requires a peer of react@^15.3.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-syntax-highlighter@15.4.3 requires a peer of react@>= 0.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-immutable-pure-component@1.2.4 requires a peer of react@>= 15 but none is installed. You must install peer dependencies yourself.
npm WARN react-immutable-pure-component@1.2.4 requires a peer of react-dom@>= 15 but none is installed. You must install peer dependencies yourself.
npm WARN test No description
npm WARN test No repository field.
npm WARN test No license field.

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! swagger-client@3.13.0 postinstall: `husky install`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the swagger-client@3.13.0 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/aaa/.npm/_logs/2021-02-11T14_31_34_996Z-debug.log

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions