2016-12-16 89 views
1

更新時間:安裝角2通用

我試圖安裝使用this導角2通用,但是當我運行下面的命令,我得到了一些錯誤。

下面是一個命令:

typings install node express body-parser serve-static dexpress-serve-static-core mime --global --save 

,並且錯誤是:

C:\Users\user\Desktop\myApp>typings install node express body-parser serve-static dexpress-serve-static-core mime --global --save 
typings INFO globaldependencies "express" lists global dependencies on "node" that must be installed manually 
typings INFO globaldependencies "serve-static" lists global dependencies on "node" that must be installed manually 
typings INFO globaldependencies "body-parser" lists global dependencies on "node" that must be installed manually 
typings ERR! message Unable to find "node" ("npm") in the registry. 
typings ERR! message However, we found "node" for 2 other sources: "dt" and "env" 
typings ERR! message You can install these using the "source" option. 
typings ERR! message We could use your help adding these typings to the registry: https://github.com/typings/registry 
typings ERR! caused by https://api.typings.org/entries/npm/node/versions/latest responded with 404, expected it to equal 200 
typings ERR! 
typings ERR! cwd C:\Users\user\Desktop\myApp 
typings ERR! system Windows_NT 10.0.14393 
typings ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\typings\\dist\\bin.js" "install" "node" "express" "body-parser" "serve-static" "dexpress-serve-static-core" "mime" "--global" "--save" 
typings ERR! node -v v6.9.2 
typings ERR! typings -v 2.0.0 
typings ERR! 
typings ERR! If you need help, you may report this error at: 
typings ERR! <https://github.com/typings/typings/issues> 

我使用節點版本v6.9.2和NPM 4.0.5

回答

1

更新的NodeJS,只需在他們的homepage上下載LTS版本,安裝它,然後更新npm:

npm install [email protected] -g 

再次嘗試你的第一個命令,它會工作。

+0

感謝您的回答...我已經更新了兩個nodejs和npm到最新的推薦版本,但仍然收到錯誤。請參閱更新的問題。 –

0

我已經通過以下方式安裝角通用:

  1. 下載啓動項目:https://github.com/angular/universal-starter
  2. 在使用終端或IDE的項目文件夾安裝NPM。對於Mac的命令是:

    須藤NPM安裝

使用「命令」與密碼,否則那麼你可以有一些錯誤的訪問是非常重要的。

  • 運行

    NPM啓動

  • 轉到本地主機:3000