Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
How to undo Angular 2 Cli ng-eject?

I have just executed the ng eject command. But now I need to revert it, and continue to use ng commands. Is it possible?

I would be grateful for any help.

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

At https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/tasks/build.ts#L27 (current angular CLI version: 1.0.1) there is a condition:

if (config.project && config.project.ejected) {
  throw new SilentError('An ejected project cannot use the build command anymore.');
}

when you run ng-eject, package.json file is modified with new npm scripts, webpack.config.js file is added or replaced and ejected flag is added to your .angular.cli.json:

"project": {
  "name": "YOUR PROJECT NAME",
  "ejected": true
},

So, just remove "ejected" flag from your .angular.cli.json file:

or change this flag to false:

"project": {
  "name": "YOUR PROJECT NAME",
  "ejected": false
}
about 4 years ago · Santiago Trujillo Report

0

With current version of angular cli you need to mark ejected:false or remove the ejected property inside file angular-cli.json file instead of package.json file

about 4 years ago · Santiago Trujillo Report

0

This command makes the build configuration part of your project and gets rid of Angular CLI. And also set “ejected”: true in angular-cli.json file , create new file webpack.config.js in project root, and modified run scripts in package.json.

Finally, to undo the ng-eject command it is necessary to modify the package.json file again

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!