简体   繁体   English

ts-node 错误:找不到兼容的 `parseConfigFile` 函数

[英]ts-node error: Could not find a compatible `parseConfigFile` function

I just install the ts-node with npm install -g ts-node but I can't execute the REPL, it gives me this error:我刚刚安装ts-nodenpm install -g ts-node ,但我不能执行REPL,它给了我这个错误:

/usr/lib/node_modules/ts-node/src/index.ts:478
  throw new TypeError('Could not find a compatible `parseConfigFile` function')
        ^
TypeError: Could not find a compatible `parseConfigFile` function
    at readConfig (/usr/lib/node_modules/ts-node/src/index.ts:478:9)
    at Object.register (/usr/lib/node_modules/ts-node/src/index.ts:205:18)
    at Object.<anonymous> (/usr/lib/node_modules/ts-node/src/_bin.ts:136:17)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)

I'm using Fedora 27. Any idea?我正在使用 Fedora 27。知道吗?

Regards,问候,

This may be a Fedora problem.这可能是 Fedora 的问题。 I installed typescript with dnf and ts-node with npm .我安装了带有dnf typescript和带有npm ts-node To fix I had to uninstall the typescript with dnf remove -y nodejs-typescript and reinstall it with npm i -g typescript .为了解决这个问题,我不得不用dnf remove -y nodejs-typescript卸载typescript ,然后用npm i -g typescript dnf remove -y nodejs-typescript重新安装它。

The installation commands need root permissions to write to system folders.安装命令需要 root 权限才能写入系统文件夹。 Now everything works fine.现在一切正常。 :-) :-)

Regards.问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM