Skip to content

Commit e19db8e

Browse files
authored
fix: require specific node version for Make (#543)
1 parent c3e145d commit e19db8e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ $(warning Your Golang version is go$(shell expr $(GOVERSION) / 1000000).$(shell
1313
$(error Update Golang to version to at least 1.16.0)
1414
endif
1515

16+
LTS_NODE_VER=16
17+
NODE_VER=$(shell node -v)
18+
ifeq ($(patsubst v$(LTS_NODE_VER).%,matched,$(NODE_VER)), matched)
19+
NODE_LTS=true
20+
else
21+
NODE_LTS=false
22+
endif
23+
1624
# git modules that need to be loaded
1725
MODULES:=
1826

@@ -92,11 +100,16 @@ boostci: $(BUILD_DEPS)
92100
$(GOCC) build $(GOFLAGS) -o boostci ./cmd/boostci
93101
.PHONY: boostci
94102

95-
react:
103+
react: check-node-lts
96104
npm install --prefix react
97105
npm run --prefix react build
98106
.PHONY: react
99107

108+
.PHONY: check-node-lts
109+
check-node-lts:
110+
@$(NODE_LTS) || echo Build requires Node v$(LTS_NODE_VER) \(detected Node $(NODE_VER)\)
111+
@$(NODE_LTS) && echo Building using Node v$(LTS_NODE_VER)
112+
100113
build-go: boost devnet
101114
.PHONY: build-go
102115

0 commit comments

Comments
 (0)