0
我正在研究一個在某些時候使用提取的打字稿項目。在Typescript項目中使用提取
我知道,我可以用分型做出的定義獲取全球可用:
typings install --global --save dt~whatwg-fetch
& typings install --global --save dt~whatwg-streams
但我想從我的依賴移開的分型,而使用NPM和@types。
但我無法弄清楚如何使這項工作。
我已經做了npm install @types/whatwg-fetch
和增加取我tsconfig.json文件的compilerOptions.types數組,但我仍然得到一個錯誤:Error Cannot find type definition file for 'fetch'.