Use npm from the tools directory, not the system one

Also this fixes the missing $(NODE) usage, that was resolving to empty,
hence finally resolving `npm` by /chance/...

yet another 🤦
This commit is contained in:
Baptiste Mathus 2018-10-26 07:03:31 +02:00
parent a3d2031a81
commit 4e3ef2d76e
1 changed files with 7 additions and 4 deletions

View File

@ -1,3 +1,6 @@
ROOT:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PATH:=$(ROOT)/tools/:$(PATH)
clean:
$(MAKE) -C distribution $@
$(MAKE) -C services $@
@ -23,15 +26,15 @@ update-package-locks:
# https://npm.community/t/some-packages-have-dist-tarball-as-http-and-not-https/285/13
rm -rf services/node_modules/ services/package-lock.json && \
rm -rf distribution/client/node_modules/ distribution/client/package-lock.json && \
cd services/ && $(NODE) npm install && \
cd services/ && npm install && \
sed -i 's/"resolved": "http:/"resolved": "https:/g' package-lock.json && \
cd ../distribution/client && $(NODE) npm install && \
cd ../distribution/client && npm install && \
sed -i 's/"resolved": "http:/"resolved": "https:/g' package-lock.json
npm-audit-fix:
# Sigh, the sed for forcing https below is recommended by the npm registry team itself...
# https://npm.community/t/some-packages-have-dist-tarball-as-http-and-not-https/285/13
cd services/ && $(NODE) npm audit fix && \
cd services/ && npm audit fix && \
sed -i 's/"resolved": "http:/"resolved": "https:/g' package-lock.json && \
cd ../distribution/client && $(NODE) npm audit fix && \
cd ../distribution/client && npm audit fix && \
sed -i 's/"resolved": "http:/"resolved": "https:/g' package-lock.json