1

I'm trying to install mattlewis92's angular 14.0+ calendar, which suggests the use of the command ng add angular-calendar. However when doing so I got an error:

npm ERR! command C:\Windows\system32\cmd.exe /d /s /c husky install
npm ERR! 'husky' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

I realized that I don't have husky as a dependency so I added it according to husky's docs. Unfortunately after installing husky I got a new error:

npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c husky install
npm ERR! husky - .git can't be found (see https://typicode.github.io/husky/#/?id=custom-directory)

I followed the suggested link above huksy docs/ Recipes/ Custom directory, but I have no common problem as package.json as well as .git and .husky are all in the same directory level -> in my project's root folder.

All suggestions are welcome!

Naydenow
  • 21
  • 1
  • 5

2 Answers2

0

You could

1. Update your node.js version

This is the accepted node js version found over their website Node.js (>=14.19.0 or >=16.9.0)

So if, you do not have those version -> update it.

2. Use a former version

You do not want to update your node.js version ?
Downgrade to the following -> angular-calendar: 0.29.0

3. Dirty Workaround

The library cannot install the calendar-utils.

Funnily enough, running npm i angular-calendar outside an angular project worked just fine

So what you can do.

  1. run npm i angular-utils somewhere outside an angular project
  2. Copy the generated information node_modules, package.json & package-lock.json inside your project
  3. run npm i angular-calendar
  4. Then if you which, ng add angular-calendar should work just fine.
Raphaël Balet
  • 6,334
  • 6
  • 41
  • 78
0

In my case, everything was fine except parent folder of the project had .git.

Husky found a problem as .git in parent folder whereas project in child folder of it.

I removed .git from parent folder as git was mistakenly init in parent folder.

Kiran
  • 469
  • 1
  • 7
  • 17