ngcc error on package @sitecore-jss/sitecore-jss-angular
See original GitHub issue🐞 bug report
Affected Package
@sitecore-jss/sitecore-jss-angular
Description
Trying to update an NX repo running the npm run update command. This results in trying to upgrade to angular 9, which was the ultimate goal.
Along the way I get this error:
Error: Error on worker #3: Error: Tried to overwrite <removed>/node_modules/@sitecore-jss/sitecore-jss-angular/dist/components/file.directive.d.ts.__ivy_ngcc_bak with an ngcc back up file, which is disallowed.
I have already tried clearing npm node_modules, clean install etc. No effect.
🔬 Minimal Reproduction
This can be repro-ed by installing the @sitecore-jss/sitecore-jss-angular package and the running the following command:
ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points
🌍 Your Environment
Angular Version:
Updating package.json with dependency @nrwl/angular @ "9.1.2" (was "8.12.1")...
The NX update process tries to update as follows:
Updating package.json with dependency @angular/cli @ "9.0.1" (was "8.3.3")...
Updating package.json with dependency @angular/language-service @ "9.0.7" (was "8.2.8")...
Updating package.json with dependency @angular-devkit/build-angular @ "0.900.1" (was "0.803.3")...
Updating package.json with dependency @angular/compiler-cli @ "9.0.7" (was "8.2.8")...
Updating package.json with dependency @angular/animations @ "9.0.7" (was "8.2.8")...
Updating package.json with dependency @angular/common @ "9.0.7" (was "8.2.8")...
Updating package.json with dependency @angular/core @ "9.0.7" (was "8.2.8")...
Updating package.json with dependency @angular/forms @ "9.0.7" (was "8.2.8")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "9.0.7" (was "8.2.8")...
Updating package.json with dependency @angular/platform-browser @ "9.0.7" (was "8.2.8")...
Updating package.json with dependency @angular/compiler @ "9.0.7" (was "8.2.8")...
Updating package.json with dependency @angular/router @ "9.0.7" (was "8.2.8")...
I’m not sure whether I should file the report here or on the sitecore-jss repo. If this is the wrong place, please let me know.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Hallo Erik! 🇳🇱
This package appears to incorrectly include two
package.json
files. These are processed by ngcc individually, but they target the same files. ngcc disallows this; files should only be processed once.Can you try ignoring the
package.json
in thedist
directory by creating angcc.config.js
file next to yourpackage.json
:If I didn’t make a mistake in typing that, it should start to work. I do recommend to clear
node_modules
once more before trying again.This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.