From 4958c800da64d9c32e1a9093faabf35e5bc24d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 18 Jan 2022 11:37:54 +0100 Subject: [PATCH] build: fix npm version detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Npm's package.json now contains two fields named "version". Grep for the top-level one. Fixes: https://github.com/nodejs/build/issues/2850 PR-URL: https://github.com/nodejs/node/pull/41575 Reviewed-By: Antoine du Hamel Reviewed-By: Vladimir de Turckheim Reviewed-By: Filip Skokan Reviewed-By: Evan Lucas Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Zijian Liu Reviewed-By: Matteo Collina Reviewed-By: Christian Clauss Reviewed-By: Tobias Nießen --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a2ffd0652a6696..cc455e39ecbdb5 100644 --- a/Makefile +++ b/Makefile @@ -830,7 +830,7 @@ PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]') ifeq ($(findstring os/390,$PLATFORM),os/390) PLATFORM ?= os390 endif -NPMVERSION=v$(shell cat deps/npm/package.json | grep '"version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/') +NPMVERSION=v$(shell cat deps/npm/package.json | grep '^ "version"' | sed 's/^[^:]*: "\([^"]*\)",.*/\1/') UNAME_M=$(shell uname -m) ifeq ($(findstring x86_64,$(UNAME_M)),x86_64)