我想在我的應用程序中使用expressjs。如何安裝快遞類型?
使用typings install express --ambient --save
安裝它後,我跑tsc
,但我得到兩個錯誤:
typings/main/ambient/express/index.d.ts(17,34): error TS2307: Cannot find module 'serve-static'. typings/main/ambient/express/index.d.ts(18,27): error TS2307: Cannot find module 'express-serve-static-core'.
所以,我試圖同時安裝:
typings install serve-static --ambient --save
typings install express-serve-static --ambient --save
,然後我再次運行TSC,但得到一個更多的錯誤:
typings/main/ambient/serve-static/index.d.ts(79,24): error TS2307: Cannot find module 'mime'.
我該如何解決這些問題?我如何自動安裝Express的所有依賴關係?
隨着分型1.0,我相信這是現在:'分型安裝DT〜啞劇--global --save' –
現在(OCT 2016)正確的命令是'分型安裝mime --global --save --source dt' –