1

I had a working angular project, and wanted to try NativeScript, so I added NativeScript to it using npm install --global @nativescript/schematics and ng add @nativescript/schematics but now when I try to run ng serve I get this error

ERROR in error TS6053: File 'C:[path]/src/src/main.ts' not found.

error TS6053: File 'C:[path]/src/src/polyfills.ts' not found.

I tried deleting node_modlues, and running npm install again, but the error is the same. I even tried restarting my terminal and run ng serve again and the result is the same

Did I do something wrong? Or did i forget to do something?

EDIT

tsconfig.app.json file:

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "types": [],
    "paths": {
      "@src/*": [
        "src/*.web",
        "src/*"
      ]
    }
  },
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ],
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ]
}
Community
  • 1
  • 1
Darius Biro
  • 169
  • 1
  • 3
  • 12

3 Answers3

1

It seems as a problem with paths or files properties inside tsconfig.app.json. Can you paste it here to check if this is the case?

Fatme
  • 121
  • 2
1

Remove the keyword 'src/' from the paths mentioned in the files array and try. checkout this - https://github.com/NativeScript/nativescript-schematics/issues/240 Hope this helps.

Allabakash
  • 1,969
  • 1
  • 9
  • 15
0

Another way to fix this is to change the location of main file inside angular.json -> "main": "src/main.ts"

Fatme
  • 121
  • 2