TypeScript @types模块无法parsing对方
当我使用npm来安装类似于这样的TypeScript定义时
npm install --save @types/express
我无法使用已安装的模块,因为它们无法解决对方。 例如,@ types / express需要@ types / express-static-server-core,但是@types/express/index.d.ts
包含express-static-server-core
的相对path,所以无法parsing该模块:
node_modules/@types/express/index.d.ts(16,30): error TS2307: Cannot find module 'serve-static'. node_modules/@types/express/index.d.ts(17,23): error TS2307: Cannot find module 'express-serve-static-core'. node_modules/@types/serve-static/index.d.ts(15,26): error TS2307: Cannot find module 'express-serve-static-core'. node_modules/@types/serve-static/index.d.ts(16,20): error TS2307: Cannot find module 'mime'.
我该如何解决这个问题? 什么是安装TypeScript定义的最佳方法?
据我所知,typings已被弃用,所以我试图从@types安装types定义,然后使用
tsc --target ES5 --module commonjs index.ts
但它不工作。 我究竟做错了什么?
- 如何将第三方Javascript文件导入到IntelliJ中,以便我可以在一个Typescript文件中引用它
- TypeOrm – OneToOne连接更新尝试删除相关logging
- TypeScript是否为NodeJS模块访问提供了明确的公共API?
- 我如何添加我的自定义npm包到TypeScript定义pipe理器?
- 在Node.js中使用TypeScriptasynchronous等待
- 如何find在Node + Typescript + VSCodeasynchronous函数调用缺less的等待?
- Angular 2快速入门 – 我的应用程序组件不加载
- 从Javascript调用Typescript类时的语法
- Typescript:属性“已解码”在types请求中不存在