相关疑难解决方法(0)

找不到模块'module-name'的声明文件.'/path/to/module-name.js'隐式具有'any'类型

我读了TypeScript 模块解析的工作原理.

我有以下存储库:ts-di.编译目录结构后如下:

??? dist
?   ??? annotations.d.ts
?   ??? annotations.js
?   ??? index.d.ts
?   ??? index.js
?   ??? injector.d.ts
?   ??? injector.js
?   ??? profiler.d.ts
?   ??? profiler.js
?   ??? providers.d.ts
?   ??? providers.js
?   ??? util.d.ts
?   ??? util.js
??? LICENSE
??? package.json
??? README.md
??? src
?   ??? annotations.ts
?   ??? index.ts
?   ??? injector.ts
?   ??? profiler.ts
?   ??? providers.ts
?   ??? util.ts
??? tsconfig.json
Run Code Online (Sandbox Code Playgroud)

在我的package.json中,我写道"main": "dist/index.js".

在Node.js中一切正常,但TypeScript:

import {Injector} from …
Run Code Online (Sandbox Code Playgroud)

node-modules typescript

199
推荐指数
19
解决办法
24万
查看次数

标签 统计

node-modules ×1

typescript ×1