Tag: typescript

Typescript导入语句不能在Docker容器中工作

我有一个用Typescript编写的项目,它使用jasmine-ts来运行一系列的testing。 我需要创build一个Docker容器来运行testing有几个原因。 虽然项目本地运行OK npm test : c:\github\gareththegeek\corewar>npm test > corewar@0.0.26 test c:\github\gareththegeek\corewar > nyc jasmine-ts Started …………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………….. 503 specs, 0 failures Finished in 0.893 seconds 当我containerise相同的文件夹,并从泊坞窗图像运行npm test ,Typescriptimport似乎不被认可。 c:\github\gareththegeek\corewar>docker run corewar > corewar@0.0.26 test /usr/src/app > nyc jasmine-ts /usr/src/app/node_modules/ts-node/src/index.ts:307 throw new TSError(formatDiagnostics(diagnosticList, cwd, ts, lineOffset)) ^ TSError: ⨯ Unable to compile TypeScript parser/Expression.ts (1,29): Cannot […]