diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..c42da845b4 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict = true diff --git a/aio/.npmrc b/aio/.npmrc new file mode 100644 index 0000000000..c42da845b4 --- /dev/null +++ b/aio/.npmrc @@ -0,0 +1 @@ +engine-strict = true diff --git a/aio/package.json b/aio/package.json index 781ca7875c..4bc0d0cae8 100644 --- a/aio/package.json +++ b/aio/package.json @@ -6,7 +6,6 @@ "author": "Angular", "license": "MIT", "scripts": { - "preinstall": "node ../tools/yarn/check-yarn.js", "postinstall": "node tools/cli-patches/patch.js", "aio-use-local": "node tools/ng-packages-installer overwrite . --debug --force --build-packages", "aio-use-npm": "node tools/ng-packages-installer restore .", @@ -86,7 +85,8 @@ "//engines-comment": "Keep this in sync with /package.json and /aio/tools/examples/shared/package.json", "engines": { "node": ">=10.19.0 <16.0.0", - "yarn": ">=1.22.4 <2" + "yarn": ">=1.22.4 <2", + "npm": "Please use yarn instead of NPM to install dependencies" }, "private": true, "dependencies": { diff --git a/aio/tools/examples/shared/.npmrc b/aio/tools/examples/shared/.npmrc new file mode 100644 index 0000000000..c42da845b4 --- /dev/null +++ b/aio/tools/examples/shared/.npmrc @@ -0,0 +1 @@ +engine-strict = true diff --git a/aio/tools/examples/shared/package.json b/aio/tools/examples/shared/package.json index 579ca4c0c1..065258d56d 100644 --- a/aio/tools/examples/shared/package.json +++ b/aio/tools/examples/shared/package.json @@ -7,14 +7,15 @@ "http-server": "http-server", "protractor": "protractor", "webdriver:update": "node ../../../../scripts/webdriver-manager-update.js", - "preinstall": "node ../../../../tools/yarn/check-yarn.js", "postinstall": "yarn webdriver:update", "sync-deps": "node sync-boilerplate-dependencies" }, "//engines-comment": "Keep this in sync with /package.json and /aio/package.json", "engines": { "node": ">=10.19.0 <16.0.0", - "yarn": ">=1.21.1 <2" + "yarn": ">=1.21.1 <2", + "npm": "Please use yarn instead of NPM to install dependencies" + }, "keywords": [], "author": "", diff --git a/package.json b/package.json index 63213f8eeb..df836535d4 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "//engines-comment": "Keep this in sync with /aio/package.json and /aio/tools/examples/shared/package.json", "engines": { "node": ">=10.19.0 <16.0.0", - "yarn": ">=1.22.4 <2" + "yarn": ">=1.22.4 <2", + "npm": "Please use yarn instead of NPM to install dependencies" }, "repository": { "type": "git", @@ -31,7 +32,6 @@ "// 2": "Find the usage you are looking for with:", "// 3": "yarn ng-dev --help", "/ ": "", - "preinstall": "node tools/yarn/check-yarn.js", "postinstall": "node scripts/webdriver-manager-update.js && node --preserve-symlinks --preserve-symlinks-main ./tools/postinstall-patches.js", "prepare": "husky install", "test-ivy-aot": "bazelisk test --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot", diff --git a/tools/yarn/check-yarn.js b/tools/yarn/check-yarn.js deleted file mode 100644 index 8fc3010639..0000000000 --- a/tools/yarn/check-yarn.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -'use strict'; - -if (process.env.npm_execpath.indexOf('yarn') === -1) { - throw new Error( - 'Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/'); -}