From 5b196e5f06c08c6d0d17def762491eac0c2ccbb7 Mon Sep 17 00:00:00 2001 From: Jean Honlet Date: Fri, 25 Nov 2022 09:21:36 +0000 Subject: [PATCH] fix: npm bin dissapeared https://github.com/npm/statusboard/issues/537 --- .husky/commit-msg | 2 +- .husky/pre-commit | 2 +- Makefile | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index bc904914..dd0104eb 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -"$(npm bin)"/commitlint --edit "$1" \ No newline at end of file +"$(npm root)"/.bin/commitlint --edit "$1" \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index 33d56485..1cddcea8 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -"$(npm bin)"/lint-staged +"$(npm root)"/.bin/lint-staged diff --git a/Makefile b/Makefile index 6cb9feba..cbd5854d 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,8 @@ KIOSK_CONFIG ?= $(ROOT)/etc/kiosk.yml SHELL := /bin/bash .SECONDEXPANSION: -PATH := $(shell npm bin):$(PATH) +NPM_BIN=$(shell npm root)/.bin +PATH := $(NPM_BIN):$(PATH) dump: $(info ROOT: $(ROOT)) @@ -106,11 +107,11 @@ node_modules/.packages-installed.json: package.json package-lock.json .PHONY: browserslist browserslist: - $(shell npm bin)/browserslist --update-db + $(NPM_BIN)/browserslist --update-db tmp/importmap.json: mkdir -p "$(dir $@)" - $(shell npm bin)/importly < package-lock.json > "$@" + $(NPM_BIN)/importly < package-lock.json > "$@" .PHONY: test test: test-server test-client