Export Angular project from StackBlitz to local

后端 未结 6 428
暖寄归人
暖寄归人 2021-02-01 03:25

I would like to export an Angular project done in StackBlitz an execute it from Angular CLI with the command ng serveas we do with an Angular project created in our

6条回答
  •  梦如初夏
    2021-02-01 03:51

    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.

提交回复
热议问题