angular-cn/tools
Joey Perrott c385e74454 build: rely on engines to prevent using npm for dependency install (#41477)
Rather than relying on a preinstall script, set `engine-strict` to `true` in a
project `.npmrc` file, relying on the `engines` having `npm` set to note that
yarn should be used instead.

---

Output from `npm install` changes from:
```
$ npm install

> angular-srcs@12.0.0-next.7 preinstall /usr/local/account/js/angular
> node tools/yarn/check-yarn.js

/usr/local/account/js/angular/tools/yarn/check-yarn.js:12
  throw new Error(
  ^

Error: Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/
    at Object.<anonymous> (/usr/local/account/js/angular/tools/yarn/check-yarn.js:12:9)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! angular-srcs@12.0.0-next.7 preinstall: `node tools/yarn/check-yarn.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-srcs@12.0.0-next.7 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/local/account/.npm/_logs/2021-04-06T22_54_02_292Z-debug.log
```
to
```
$ npm install
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for angular-srcs@12.0.0-next.7: wanted: {"node":">=10.19.0 <13.0.0","yarn":">=1.22.4 <2","npm":"Plesae use yarn instead of NPM to install dependencies"} (current: {"node":"10.20.1","npm":"6.14.4"})
npm ERR! notsup Not compatible with your version of node/npm: angular-srcs@12.0.0-next.7
npm ERR! notsup Not compatible with your version of node/npm: angular-srcs@12.0.0-next.7
npm ERR! notsup Required: {"node":">=10.19.0 <13.0.0","yarn":">=1.22.4 <2","npm":"Plesae use yarn instead of NPM to install dependencies"}
npm ERR! notsup Actual:   {"npm":"6.14.4","node":"10.20.1"}

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/local/account/.npm/_logs/2021-04-06T22_53_23_912Z-debug.log
```

PR Close #41477
2021-04-07 12:05:01 -07:00
..
build build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
circular_dependency_test build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
contributing-stats build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
gulp-tasks build: update to cldr v37 (#39343) 2020-10-20 13:22:37 -07:00
npm build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
npm_integration_test build: upgrade angular build, integration/bazel and @angular/bazel package to rule_nodejs 2.2.0 (#39182) 2020-10-08 11:54:59 -07:00
rxjs build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
saucelabs build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
size-tracking build: update tools directory for latest changes in rules_nodejs (#40710) 2021-02-09 10:48:43 -08:00
source-map-test build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
symbol-extractor build: update tools directory for latest changes in rules_nodejs (#40710) 2021-02-09 10:48:43 -08:00
testing refactor(core): remove unused fakeAsyncFallback and asyncFallback (#37879) 2020-11-20 08:34:59 -08:00
ts-api-guardian feat(core): support TypeScript 4.2 (#41158) 2021-03-17 09:10:25 -07:00
tslint build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
BUILD.bazel build: upgrade angular build, integration/bazel and @angular/bazel package to rule_nodejs 2.2.0 (#39182) 2020-10-08 11:54:59 -07:00
defaults.bzl build: emit performance JSON file for each ng_module() (#41125) 2021-03-24 13:42:25 -07:00
inline-package-json-deps.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
jasmine-seed-generator.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
ng_benchmark.bzl refactor(dev-infra): ng_rollup_bundle rule should leverage `@bazel/rollup` (#37623) 2020-06-22 10:55:28 -07:00
postinstall-patches.js build: update tools directory for latest changes in rules_nodejs (#40710) 2021-02-09 10:48:43 -08:00
tsconfig-test.json build(bazel): use fine-grained npm deps (#26111) (#26488) 2018-10-19 20:59:29 -07:00
tsconfig.json build: ts-api-guardian tsconfig warning with bazel (#27583) 2018-12-13 11:01:48 -08:00
types.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
utils.bzl build: create macro for transpiling javascript file to es5 (#36802) 2020-05-04 12:43:50 -07:00
utils.inc feat(bundle): add script to push bundles to code.angularjs.org 2015-04-14 14:50:53 -07:00