Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to load Schema -- angular.json file

I am getting below error in angular.json file , where schema is not loading properly, getting error unable to load schema, first line of below code giving me error, see below

{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "mrr": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {

both angular.json and node_modules is in the same level.

like image 752
Abhi Avatar asked Mar 19 '20 15:03

Abhi


2 Answers

Hi Abhishek is a problem related to Angular 9 or Node 12 i had the same issue i had the same issue so i rollback to node 11 and angular 8 and everything is fine

[Update] i update angular and node and everything is fine the problem is solved in 9.1.6 you can check the issue on github https://github.com/angular/angular/issues/35154

Steps i follow

  • npm cache clean
  • npm install -g @angular/cli

If you are having trouble with npm install, use the -verbose option to see more details.

  • after all of this ng update

This will fix this error.

like image 70
Antonio Cardenas Avatar answered Nov 09 '22 12:11

Antonio Cardenas


I got this in VSCode when I accidentally started it without first running "npm install" in an Angular project after restructuring my work directory and wiping out some node_modules directories in the process to avoid time-consuming copy operations.

Naturally, when I got the error I didn't even bother to check if node_modules was there, I "just knew" that it was. (I had in fact already run "npm install" in all but that one project directory.)

After closing VSCode, running "npm install" in the Angular project directory and starting VSCode again, the error went away.

like image 7
User 16415578 Avatar answered Nov 09 '22 13:11

User 16415578