2017-06-02 125 views
0

我不熟悉角項目的工作,我有一個新的角度項目,部分完成,我試圖用Angular cli來運行項目,我嘗試了所有可能的方式,我在網上找到了。我試過This method演出一些警告編譯並運行Angular Project?

``-- [email protected] `-- UNMET PEER DEPENDENCY [email protected]^5.0.1 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 
(node_modules\angular-cli\node_modules\chokidar\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for 
[email protected]: wanted {"os":"darwin","arch":"any"} (current: { 
"os":"win32","arch":"x64"}) 
npm WARN @angular/[email protected] requires a peer of [email protected]^5.0.1 but none was 
installed.` 

當我使用 npm install npm start 顯示一些錯誤

`npm ERR! Windows_NT 10.0.14393 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program 
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" 
npm ERR! node v6.10.3 
npm ERR! npm v3.10.10 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] start: ng serve 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'ng serve'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the my-dream-app 
package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  ng serve 
npm ERR! You can get information on how to open an issue for this project 
with: 
npm ERR!  npm bugs my-dream-app 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls my-dream-app 
npm ERR! There is likely additional logging output above. 
npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\PC\Desktop\my-dream-app\npm-debug.log` 

Structure of the project

如何編譯和運行該項目?

回答

1

我認爲你安裝的本地軟件包成功,但運行項目失敗。 你可以試試這個命令:

ng serve 

在您有需要,請參考本文檔,以獲得正確的設置爲角CLI https://github.com/angular/angular-cli#prerequisites

+0

使用'NG serve'情況時顯示「你必須在裏面一個角色cli項目,以便使用serve命令。「 – Ajith

+0

您是否安裝了angular-cli,除非請先運行這個命令:'npm install -g @ angular/cli'。並cd到項目內部並運行'ng serve'。 –

+0

@AjithVManali在命令行中,你是否在'我的夢想應用程序'? – borislemke