我因为在index.js
文件旁边有一个文件而收到此错误index.ts
。我以某种方式将我的 TS 渲染到我的 rootDir 源文件夹。
终端抓取错误并修复:
> node --loader ts-node/esm src/index.ts
/sandbox/node_modules/ts-node/src/index.ts:944
throw new TypeError(`${relative(cwd, fileName)}: Emit skipped`);
^
TypeError: src/services/index.js: Emit skipped
at getOutput (/sandbox/node_modules/ts-node/src/index.ts:944:17)
at Object.compile (/sandbox/node_modules/ts-node/src/index.ts:1243:30)
at /sandbox/node_modules/ts-node/src/esm.ts:282:37
at Generator.next (<anonymous>)
at /sandbox/node_modules/ts-node/dist/esm.js:8:71
at new Promise (<anonymous>)
at __awaiter (/sandbox/node_modules/ts-node/dist/esm.js:4:12)
at transformSource (/sandbox/node_modules/ts-node/dist/esm.js:127:16)
at /sandbox/node_modules/ts-node/src/esm.ts:197:51
at Generator.next (<anonymous>)
sandbox@sse-sandbox-4stfq:/sandbox$ ls src/services/
index.js index.ts user
sandbox@sse-sandbox-4stfq:/sandbox$ rm src/services/index.js