diff --git a/package.json b/package.json index f5841a1..40c46f4 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "Code Coverage" ], "scripts": { + "preinstall": "node scripts/preinstall.js", "postinstall": "npx husky install", "ng": "ng", "start": "ng s", @@ -81,7 +82,9 @@ "v8-to-istanbul": "^9.1.0" }, "lint-staged": { - "*.{js,ts,css,scss,html,md}": "prettier --write" + "*.{js,ts,css,scss,html,md}": [ + "prettier --write" + ] }, "engines": { "node": "20.x.x", diff --git a/scripts/preinstall.js b/scripts/preinstall.js new file mode 100644 index 0000000..0634bcf --- /dev/null +++ b/scripts/preinstall.js @@ -0,0 +1,27 @@ +if ( + process.env.npm_execpath.indexOf("npm") === -1 && + process.env.npm_execpath.indexOf("yarn") === -1 +) { + throw new Error(` + + ################################################### + # # + # Please use Yarn > 1.3 to install dependencies # + # # + # 1. Install yarn (https://yarnpkg.com/) # + # 2. Run 'yarn' # + # # + ################################################### + + OR + + ################################################### + # # + # Please use NPM to install dependencies # + # # + # 1. Install npm (https://npmjs.com/) # + # 2. Run 'npm install' # + # # + ################################################### + `); +}