我正在使用 Angular2-Meteor、TypeScript。 ( meteor 版本1.3.2.4)
当我在服务器端使用console.log('test');
时,它运行良好。
但是,我在终端中收到此警告:
Cannot find name 'console'.
如何消除这个警告?
或者服务器端是否有特殊的方法,例如Meteor.log
?谢谢
最佳答案
How can I get rid of this warning?
如果它是 TypeScript 编译器警告(而不是运行时警告),则在 lib.d.ts
中定义 console
:https://basarat.gitbooks.io/typescript/content/docs/types/lib.d.ts.html
确保编译器设置正确(例如没有 --noLib
或某些自定义不正确 --lib
)。您可能需要查看 tsconfig.json
的 compilerOptions
(如果有)
关于meteor - 找不到名称 'console',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36832186/