Skip to main content

All Questions

Tagged with
1 vote
1 answer
2k views

Husky pre-commit not running until after commit

Desired result: when I commit, prior to committing, run npm run build, which will generate some new files. I want those files to be added to the commit. The current state of affairs: when I commit, it ...
George Pickett's user avatar
1 vote
1 answer
655 views

Is there a way to have "local-only" npm scripts so they aren't committed to repo?

I'm developing a React project, which normally runs on port 3000. However, on my machine that port is used by a Windows service that I'll be using for other projects. So, in my package.json for this ...
Jeremy Kolassa's user avatar
0 votes
1 answer
4k views

Prevent commit if below jest test coverage threshold using husky hook

I have a next.js project with a husky hook running my jest test suite. I've set the code coverage requirement to be 95% code coverage however the test suite finishes running and commits anyway. I can'...
Faahmed's user avatar
  • 425
2 votes
1 answer
797 views

NPM - staged files not adding to commit with npm version

Currently trying to configure npm so that when I run npm version, it sets the version in package.json, then adds everything currently staged to its commit, and npm docs make it seem like this is ...
Wubzy's user avatar
  • 764
1 vote
1 answer
918 views

NPM script should fail if there are uncommitted git changes

How to configure npm pre-hook which should check for uncommitted git changes and allow main script to run only if there are no uncommitted git changes. I'm not using husky and it would be great if it ...
GorvGoyl's user avatar
  • 50k
3 votes
0 answers
247 views

How should a Typescript library be built that is intended to be install by git url?

I want to build a private library for my organisation and install it by git url. I also want to build this library using Typescript. The common way to use Typescript for NPM-published libraries is to ...
Max Yankov's user avatar
  • 13.4k
2 votes
2 answers
258 views

Long Git command causes error as npm script

I added this npm script to my package.json file: "gitlog" : "git log --graph --decorate -30 --all --date-order --date=format:'%Y-%m-%d %H:%M:%S' --pretty=format:'%C(cyan)%h%Creset %C(...
Edward Tanguay's user avatar
-1 votes
1 answer
42 views

Error While Trying to install create-react-app

I have been trying it now for the past minutes... I uninstall it and try again same error, I also install the latest version of node still same error.
Johntizy's user avatar
2 votes
2 answers
533 views

How to pass arguments and use those arguments as variables in a package.json script? [duplicate]

"scripts": { "cr": "git commit -am ${message} && git pull origin master --rebase && git push --force", } I'm trying to figure out how to run the above with something like: # yarn ...
antonpug's user avatar
  • 14.3k
3 votes
1 answer
680 views

Why does my old commits re-appear every time I update the changelog?

I am using the conventional-changelog-cli and I want to update my Changelog with my newest version (2.3.2). But when I run the npm run changelog script, random old commits get added into the new ...
Lirianna's user avatar
  • 370
9 votes
1 answer
4k views

How to pass current datetime in npm script for git commit message in Windows and cross platform?

I am working in Windows 10 and trying to use npm script for git commit with message that includes date and time of the commit: "deploy": "cd dist && git add . && git commit -m \"...
ChrisK's user avatar
  • 151
0 votes
1 answer
1k views

How to run npm script before merging one git branch to another

I'm looking for any suggestions. To describe my scenario I have a web app service on azure. We have it set up so the frontend(which uses React) is a part of the whole solution. Also we have ...
Cody W Hageman's user avatar
1 vote
0 answers
163 views

Element ref was specified as a string (view) but no owner was set when fork and edit the repo

I was working on a react project and using react-big-calendar. We need a feature that isn't supported yet by react-big-calendar, so I forked the project, updated the code (checked it locally with yarn ...
Khizar Iqbal's user avatar
1 vote
0 answers
20 views

NPM script for Heroku deployment Vue&Express app

I would like to create npm script allowing me to build and deploy Vue & Node app to public host, in my case it is Heroku. My app structure looks like this: client // Vue ...
veritimus's user avatar
3 votes
1 answer
3k views

Argument list too long - lint-staged -> tslint

In our project we ran into a weird issue after integrating lint-staged along with prettier and tslint. The idea was to apply prettier and then tslint to all files in the commit using husky pre-commit ...
Daniil Andreyevich Baunov's user avatar

15 30 50 per page