Export Angular project from StackBlitz to local

后端 未结 6 547
暖寄归人
暖寄归人 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 04:17

    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:

    1. Check in package.json which version of Angular your current project uses (look for @angular/core)
    2. install the corresponding version of the angular-cli, e. g. for v4 via npm i -g @angular/cli@^4
    3. run $ ng init in an empty directory
    4. Take the tsconfig.json, move it to your current project and make adjustments if required
    5. 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 :)

提交回复
热议问题