2016-12-05 95 views
1

我無法安裝NGC,無法安裝在Windows角AOT編譯器(NGC)7

我從快速入門GitHub的項目開始

npm install 

... 

| | +-- [email protected] 
| | +-- [email protected] 
| | | `-- [email protected] 
| | +-- [email protected] 
| | `-- [email protected] 
| `-- [email protected] 
`-- [email protected] 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (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 optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\browser-sync\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 install @angular/compiler-cli @angular/platform-server --save 

+-- @angular/[email protected] 
| `-- @angular/[email protected] 
| `-- [email protected] 
|  +-- [email protected] 
|  | `-- [email protected] 
|  `-- [email protected] 
|  `-- [email protected] 
`-- @angular/[email protected] 
    `-- [email protected] 

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\browser-sync\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 optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (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"}) 

,但我無法運行ngc

D:\WORK\ANGULAR\tutorial\quickstart-master>ngc 
'ngc' is not recognized as an internal or external command, 
operable program or batch file. 

node_modules中沒有.bin文件夾

+0

您是否嘗試過這樣的事情' 「node_modules /的.bin/NGC」 -p tsconfig-aot.json'?否則你必須添加ngc到環境變量 – yurzui

+0

如上所述,沒有.bin文件夾 – phil1234

+0

對不起,我省略了它 – yurzui

回答

1

我finaly設法使其工作,刪除node_modules並重新安裝一切

0

我在GitHub上從Minko Gechev Angular Seed AOT開始了項目。我遵循安裝說明,並克隆了git存儲庫。我忽略了fsevent警告,因爲它們不會導致任何問題。

按照此頁上的說明給了我結果。我確實傾向於運行我的npm install和其他simialr命令,使用--msvs-version和我的Visual Studio的2015年版本(--msvs-version = 2015)。

~/Development/aot (master) 
$ which ngc 
<deleted my start path> node_modules/.bin/ngc 

ngc在我的.bin文件中,我所做的只是遵循安裝說明,包括安裝和使用紗線。

+0

我提到了windows 7,而不是linux ... btw我使用官方的angular2種子,所以它應該工作,我我會嘗試找到一些角度聯繫人或論壇問他們,它應該是工作 – phil1234

+0

我使用Windows 7如您所示,但做了所有使用GIT bash工作良好的工作。 –

+0

剛剛嘗試過使用git cmd,仍然沒有.bin文件夾......我問了一個同事在他的電腦上試用,也許我的機器上出現了問題 – phil1234