一个带有导入的.ts文件,我正在从使用打字文件的先前版本中迁移。
import util = require("util");
import Promise = require("bluebird");
import onoff = require("onoff");
import Gpio = onoff.Gpio;
对于这些导入,我有@types
├── @types/bluebird@3.5.27
├── @types/node@12.0.10
├─┬ @types/onoff@3.2.1
│ └── @types/node@12.0.10 deduped
我有一个tsconfig.json文件
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"target": "es5",
"sourceMap": true,
"outDir":"./out/"
}
}
但是出现错误,我无法弄清楚如何进一步调试
lib/GPIOPort.ts(5,23): error TS2307: Cannot find module 'util'.
lib/GPIOPort.ts(6,26): error TS2307: Cannot find module 'bluebird'.
lib/GPIOPort.ts(7,24): error TS2307: Cannot find module 'onoff'.