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.

'husky install' fails on a Serverless deploy because there is no .git folder

See original GitHub issue

I am still facing issue #851 when deploying a Serverless app. The content of the Serverless folder after running npm install is only:

drwxr-xr-x    5 carlos  staff      160 Jan  9 14:43 .
drwxr-xr-x    3 carlos  staff       96 Jan  9 14:43 ..
drwxr-xr-x  164 carlos  staff     5248 Jan  9 14:43 node_modules
-rw-r--r--    1 carlos  staff  1869687 Jan  9 14:43 package-lock.json
-rw-r--r--    1 carlos  staff     4480 Jan  9 14:43 package.json

Since it’s a deploy, but not a CI environment, I couldn’t find anything useful on husky docs to sort this out.

Screen Shot 2022-01-09 at 2 51 48 PM

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
carlosdnbacommented, Jan 14, 2022

Although I see and agree, I think the package could find a way to identify if the package installation is happening in an environment without git, and not throw an error.

1reaction
typicodecommented, Apr 21, 2022

@JanFellner I’d recommend using prepare instead of postinstall. prepare will only run in “development”, whereas postinstall will always run (even when the package is installed in node_modules).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix error 'not found husky-run' when committing new ...
I checked the package.json and it has husky as a dependency, and I can see the pre-commit hook configuration for Husky in the...
Read more >
serverless | Yarn - Package Manager
Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more.
Read more >
Learn How to Setup Git Hooks in GitKraken Client
Users can define a custom path for git hooks by going to Preferences Git Hooks. Browse to the location or enter the path...
Read more >
hint: if you don't want pnpm to fail on peer dependency issues, add ...
Peer dependencies are resolved from dependencies installed higher in the dependency graph, since they share the same version as their .
Read more >
Frictionless Serverless Development: Part 1 — Setting Up ...
Frictionless Serverless Development: Part 1 — Setting Up Your Environment (husky, lint-staged, eslint, prettier, commitlint). Binary globe with police ...
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