我使用的是标准的typescript启动器,在将模块传输到screeps时,我遇到了一些问题。例如,
import * as faker from 'faker';
export function creepNamer() {
let randomName = faker.name.findName();
return _.kebabCase(`${randomName}`);
}给我一个错误,name不存在于faker上。当我检查faker时,我发现了undefined。
有人知道为什么有些模块莫名其妙地无法操作/什么也不能导出吗?
发布于 2018-10-08 23:08:44
的'http‘
示例tsconfig.json:
{
"compilerOptions": {
"module": "esnext",
"lib": ["esnext"],
"target": "es2017",
"moduleResolution": "Node",
"outDir": "dist",
"baseUrl": "src/",
"sourceMap": true,
"strict": true,
"experimentalDecorators": true,
"noImplicitReturns": true,
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false
},
"include": [
"src/**/*.ts"
],
"exclude": [
"dist",
"node_modules"
]
}是的,我等你的答复。然后我可以试着帮你做得更好。问候~
https://stackoverflow.com/questions/51585516
复制相似问题