From c79a878fcec014461c3f20aa31cf0f60c929407e Mon Sep 17 00:00:00 2001 From: pixie-cheeks <121865202+pixie-cheeks@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:56:14 +0530 Subject: [PATCH] Add minimum npm & node version requirements This change will prevent any old node or npm version from installing any packages. With this, npm will throw an error and exit immediately. This is to prevent the accidental use of unsupported versions which might cause some issues that are hard to pin-point. --- .npmrc | 1 + package-lock.json | 4 ++++ package.json | 4 ++++ 3 files changed, 9 insertions(+) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/package-lock.json b/package-lock.json index 682797e..feb4391 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,10 @@ "jest": "^29.6.4", "jest-cli": "^29.6.4", "plop": "^4.0.1" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.5.5" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index 31db502..dc5a974 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,10 @@ "jest-cli": "^29.6.4", "plop": "^4.0.1" }, + "engines": { + "npm": ">=8.5.5", + "node": ">=18.0.0" + }, "scripts": { "test": "jest", "generate": "plop"