Error on ng new --collection=@angular/bazel
See original GitHub issue🐞 Bug report
Command
- new
Is this a regression?
I don’t know.
Description
Creating a new Bazel-based project with ng new
produces an error.
🔬 Minimal Reproduction
From a freshly created Google Cloud Shell:
nvm install --lts && NG_CLI_ANALYTICS=false npm install -g @angular/cli @angular/bazel && NG_CLI_ANALYTICS=false ng new --collection=@angular/bazel --interactive=false repro
🔥 Exception or Error
Installing latest LTS version.
Downloading and installing node v12.14.1...
Downloading https://nodejs.org/dist/v12.14.1/node-v12.14.1-linux-x64.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v12.14.1 (npm v6.13.4)
/usr/local/nvm/versions/node/v12.14.1/bin/ngc-wrapped -> /usr/local/nvm/versions/node/v12.14.1/lib/node_modules/@angular/bazel/src/ngc-wrapped/index.js
/usr/local/nvm/versions/node/v12.14.1/bin/packager -> /usr/local/nvm/versions/node/v12.14.1/lib/node_modules/@angular/bazel/src/ng_package/packager.js
/usr/local/nvm/versions/node/v12.14.1/bin/xi18n -> /usr/local/nvm/versions/node/v12.14.1/lib/node_modules/@angular/bazel/src/ngc-wrapped/extract_i18n.js
/usr/local/nvm/versions/node/v12.14.1/bin/modify_tsconfig -> /usr/local/nvm/versions/node/v12.14.1/lib/node_modules/@angular/bazel/src/modify_tsconfig.js
/usr/local/nvm/versions/node/v12.14.1/bin/ng -> /usr/local/nvm/versions/node/v12.14.1/lib/node_modules/@angular/cli/bin/ng
> @angular/cli@8.3.24 postinstall /usr/local/nvm/versions/node/v12.14.1/lib/node_modules/@angular/cli
> node ./bin/postinstall/script.js
npm WARN @angular/bazel@7.2.16 requires a peer of @angular/compiler-cli@7.2.16 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/bazel@7.2.16 requires a peer of typescript@>=3.1.1 <3.3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/@angular/bazel/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ @angular/bazel@7.2.16
+ @angular/cli@8.3.24
added 449 packages from 271 contributors in 20.843s
CREATE repro/README.md (1023 bytes)
CREATE repro/.editorconfig (246 bytes)
CREATE repro/.gitignore (631 bytes)
CREATE repro/angular.json (1669 bytes)
CREATE repro/package.json (1548 bytes)
CREATE repro/tsconfig.json (543 bytes)
CREATE repro/tslint.json (1953 bytes)
CREATE repro/browserslist (429 bytes)
CREATE repro/karma.conf.js (1017 bytes)
CREATE repro/tsconfig.app.json (270 bytes)
CREATE repro/tsconfig.spec.json (270 bytes)
CREATE repro/src/favicon.ico (948 bytes)
CREATE repro/src/index.html (291 bytes)
CREATE repro/src/main.ts (372 bytes)
CREATE repro/src/polyfills.ts (2838 bytes)
CREATE repro/src/styles.css (80 bytes)
CREATE repro/src/test.ts (642 bytes)
CREATE repro/src/assets/.gitkeep (0 bytes)
CREATE repro/src/environments/environment.prod.ts (51 bytes)
CREATE repro/src/environments/environment.ts (662 bytes)
CREATE repro/src/app/app.module.ts (314 bytes)
CREATE repro/src/app/app.component.css (0 bytes)
CREATE repro/src/app/app.component.html (25498 bytes)
CREATE repro/src/app/app.component.spec.ts (978 bytes)
CREATE repro/src/app/app.component.ts (209 bytes)
CREATE repro/e2e/protractor.conf.js (808 bytes)
CREATE repro/e2e/tsconfig.json (214 bytes)
CREATE repro/e2e/src/app.e2e-spec.ts (638 bytes)
CREATE repro/e2e/src/app.po.ts (262 bytes)
CREATE repro/src/main.dev.ts (185 bytes)
CREATE repro/src/main.prod.ts (249 bytes)
CREATE repro/yarn.lock (0 bytes)
CREATE repro/BUILD.bazel (190 bytes)
CREATE repro/WORKSPACE (2023 bytes)
CREATE repro/.bazelignore (18 bytes)
CREATE repro/.bazelrc (1297 bytes)
CREATE repro/angular-metadata.tsconfig.json (540 bytes)
CREATE repro/e2e/BUILD.bazel (1204 bytes)
CREATE repro/e2e/protractor.on-prepare.js (1101 bytes)
CREATE repro/src/BUILD.bazel (3890 bytes)
CREATE repro/src/initialize_testbed.ts (432 bytes)
CREATE repro/src/rxjs_shims.js (1259 bytes)
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
> core-js@3.6.4 postinstall /home/taymonbeal/repro/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@2.6.11 postinstall /home/taymonbeal/repro/node_modules/karma/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> sauce-connect-launcher@1.3.1 postinstall /home/taymonbeal/repro/node_modules/sauce-connect-launcher
> node scripts/install.js || nodejs scripts/install.js
> @angular/cli@8.3.24 postinstall /home/taymonbeal/repro/node_modules/@angular/cli
> node ./bin/postinstall/script.js
> repro@0.0.0 postinstall /home/taymonbeal/repro
> ngc -p ./angular-metadata.tsconfig.json
node_modules/@angular/cli/commands/add-impl.d.ts(7,37): error TS2307: Cannot find module '../../../../dist-schema/packages/angular/cli/lib/config/schema'.
node_modules/@angular/common/upgrade/upgrade.d.ts(14,31): error TS2307: Cannot find module '@angular/upgrade/static'.
node_modules/@angular/router/upgrade/upgrade.d.ts(9,31): error TS2307: Cannot find module '@angular/upgrade/static'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! repro@0.0.0 postinstall: `ngc -p ./angular-metadata.tsconfig.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the repro@0.0.0 postinstall 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! /home/taymonbeal/.npm/_logs/2020-02-01T21_37_23_031Z-debug.log
Package install failed, see above.
🌍 Your Environment
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 8.3.24
Node: 12.14.1
OS: linux x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.803.24
@angular-devkit/core 8.3.24
@angular-devkit/schematics 8.3.24
@schematics/angular 8.3.24
@schematics/update 0.803.24
rxjs 6.4.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
An unhandled exception occurred: Schematic "ng-add" not ...
Error. Unable to find compatible package. Using 'latest'. ... [error] Error: Schematic "ng-add" not found in collection "@angular/bazel". at ...
Read more >ng serve - Angular
Option Description Value Type Default Value
‑‑hmr Enable hot module replacement. boolean false
‑‑host Host to listen on. string localhost
‑‑open Opens the url in default...
Read more >Ways to fix “-bash: ng: command not found” - Medium
There are few ways that we can follow to get rid of this error. 1 . Linking angular/cli with npm. This can be...
Read more >Common Angular Errors - Programming with Mosh
When creating a new project with Angular CLI, you may receive the following error: 'ng' is not recognized as an internal or external...
Read more >Identify and Fix Build and Deployment Errors in Your Angular ...
This error occurs most commonly within your development environment (while running ng serve ) when you have created a new module on the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
With the latest version, I followed the reproduction steps below and verified that
ng build
andng serve
work as expected.Alright. So it seems that:
Made it work!
Avoid using
ng new --collection=@angular/bazel
for now, until the@angular/bazel
tag has been updated on NPMHere is the working package.json: