2017-09-29 26 views
0

我有一個現有的Express項目位於〜/ Documents/projects/express-project,我想使用Angular 4。我已經在我的項目目錄使用如何在現有的Express項目中使用Angular 4

ng new express-project --directory express-project 

而嘗試,但它並沒有創造必要的角中的文件,並給出了以下消息:

$ ng new express-project --directory express-project 
error! express-project/.gitignore already exists. 
error! express-project/package.json already exists. 
Installing packages for tooling via npm. 
Installed packages for tooling via npm. 
Project 'express-project' successfully created. 

我也曾嘗試下面的命令:

ng build 

但它抱怨angular-cli.json文件。我需要做什麼才能讓Angular 4與我現有的項目合作?

+0

這是我的角4快車項目,可能你會發現它有用:https://github.com/commercialsuicide/angular2-與快車首發。它被稱爲「角2」,但裏面有角4 –

回答

1

我發現它最好創建一個文件夾兩個子文件夾,例如

-express-project 
    -server <-- copy the existing files from your project here 
    -client <-- ng new here and set the build directory in the .angular-cli json to your desired path in the server dir. 
相關問題