error TS6504: File ‘test01.js‘ is a JavaScript file. Did you mean to enable the ‘allowJs‘ option?

基于TypeScript执行命令为

这个正确执行ts文件的运行【会自动输出test01.js】


tsc test01.ts

错误:这里是错误的运行方式【这里等价于tsc自动执行test01.js,为此会报错---->tsc无法运行js文件】
tsc testo1.ts test01.js

Typescript运行错误提示:

error TS6504: File 'test01.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?

  The file is in the program because:Root file specified for compilation

猜你喜欢

转载自blog.csdn.net/weixin_43343144/article/details/120846675