I would like to export an Angular project done in StackBlitz an execute it from Angular CLI with the command ng serve
as we do with an Angular project created in our local machines.

- 3,552
- 3
- 26
- 25
7 Answers

- 678,734
- 91
- 1,224
- 1,255
-
1Thankyou so much. That was what I was looking for – Hamza Khanzada Jan 16 '20 at 10:59
-
1Changed to cloud download now, same place. see Sathia's answer below. – Dave Jun 15 '21 at 03:03
To resolve this error: ENOENT: no such file or directory, stat '/.../projectFolder/tsconfig.app.json'
After downloading the project from StackBlitz I copied the zip to a folder.
The tsconfig.app.json file for my project was located in the src folder.
To resolve the error above I replaced the property "tsConfig": "tsconfig.app.json"
with "tsConfig": "src/tsconfig.app.json"
in my angular.json file.
In the terminal I ran npm install
in the project's directory to install all the dependencies.
I then ran ng serve -o
to run the server and the app opened up in my browser successfully.
source: ENOENT: no such file or directory in tsconfig.app.json using angular 4?
Edit: The Building Locally section of https://angular.io/start/deployment gives instructions on how to build a StackBlitz application locally. It basically says to install the Angular CLI, create a new project, replace the /src folder in your new project with the /src folder from the downloaded StackBlitz project, and finally build the project.
This however did not work for me as it caused a missing Module error. What did work was replacing all the files in the new project folder that matched the files from the StackBlitz project folder. Run npm install
, npm build --prod
, and finally ng serve -o
.

- 1,315
- 13
- 12
-
-
1This solution (the first two paragraphs) worked for me with the current tools versions as of this date. I do get a warning "Your global Angular CLI version (8.3.3) is greater than your local version (7.0.7). The local Angular CLI version is used.", but it works and shouldn't matter for an elementary learning project. – Chuck Bevitt Sep 11 '19 at 18:55
-
To build locally when you get this error, it's because Stackblitz doesn't give you all the files you need for angular apps. You have to do the scaffolding with : ng new project-name Replace "project-name" with your desired project name. – georgesjeandenis Feb 28 '20 at 18:32
- Click on that button with the arrow pointing down
- cd into you project cd "your app name"
- npm install
- ng serve

- 5,236
- 11
- 49
- 100
-
2I already tried that and I get `ENOENT: no such file or directory, stat '/home/lorenzo/Code/app2909/src/tsconfig.app.json' Error: ENOENT: no such file or directory, stat '/home/lorenzo/Code/app2909/src/tsconfig.app.json'` – Lorenzo Lerate Sep 29 '18 at 07:44
-
-
-
-
This file is being specified in your .angular-cli.json file. Make sure you have the path right as it's necessary for building the project. – Patricio Vargas Sep 29 '18 at 08:12
-
2It's not working. It's like those file aren't generated by Stackblitz – Lorenzo Lerate Sep 29 '18 at 08:34
-
1
-
I see it just downloads the files but not of it's dependencies – Patricio Vargas Sep 29 '18 at 08:49
I was also trying to export a StackBlitz Angular project to my local environment but ran into some different errors (e.g. Error: Error on worker #1: TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
) -- probably due to missing files needed by my local CLI.
The Running Your App Locally section of the Angular docs (also pointed out in @HelloWorldPeace's answer), worked for me. To summarize:
- Download the project zip from StackBlitz.
- Create a blank local Angular project with the CLI:
ng new my-project-name
- Replace the
/src
folder of the new project with the/src
folder of the StackBlitz download npm install
inside the project directory andng serve
(ornpm start
)
The Angular CLI caught some typing errors in strict mode that I had to fix (didn't have to worry about them in StackBlitz), but other than that everything was working properly.

- 31
- 2
As @gal007, @tamo-studio and @jb-nizet pointed out, you should be able to just download the project, run npm install
and ng serve
, but this might not work for all projects.
It should work for any project with a current Angular version newer than version 6, I tried with v7 and it worked like a charm.
Your error message in one comment suggests the file tsconfig.json
is missing, which you can take form a newly generated project of Angular. To create such a project follow these steps:
- Check in
package.json
which version of Angular your current project uses (look for@angular/core
) - install the corresponding version of the
angular-cli
, e. g. for v4 vianpm i -g @angular/cli@^4
- run
$ ng init
in an empty directory - Take the
tsconfig.json
, move it to your current project and make adjustments if required - Now you can delete the temporairly created project
This should make it run. If it does still not work, look at StackOverflow for the error messages or start a new Question :)

- 500
- 5
- 14
It is true that StackBlitz does not generate such file. But a tsconfig.json file in a directory indicates that such directory is the root of a TypeScript project. So, you can create such file and leave it empty. It allowed me to compile from terminal. https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

- 6,911
- 8
- 47
- 70