您的nodejs版本v12.14.1与您的打字稿目标esnext之间存在不匹配
我正在使用v12.14.1版本,在我的项目中尝试键入NPM运行测试时,我会收到此警告您的nodejs版本v12.14.1与您的打字稿目标esnext之间存在不匹配。使用TS-JEST
运行测试时,这可能会导致一些意外错误
,并且我的所有测试都失败了,请您说出我应该使用什么节点版本,或者我如何修复此警告,通过我的测试
I am using v12.14.1 version, in my project when try to type npm run test, I am getting this warning There is a mismatch between your NodeJs version v12.14.1 and your TypeScript target ESNext. This might lead to some unexpected errors when running tests with ts-jest
and all my test is failed, please can you say what node version should I use, or how can I fix this warning, to pass my tests
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是在此 cheatsheet 。
您正在运行节点版本12,因此您必须设置
“ target”:“ ES2019”
和
“ lib”:[“ ES2019”]
在您的tsconfig.json
中。tsconfig的外观示例:
The answer is in this cheatsheet.
You are running node version 12, so you must set
"target": "es2019"
and
"lib": ["ES2019"]
in yourtsconfig.json
.Example of what your tsconfig can look like: