Property‘startsWith‘doesnotexistontype‘string‘.
- 电脑硬件
- 2025-07-21 21:30:01
ts运行出现下面报错:
Property 'startsWith' does not exist on type 'string'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2015' or later解决方法:
找到项目里tsconfig.json文件,
在compilerOptions下的lib里加入“ES2015”,就可以解决。
Property‘startsWith‘doesnotexistontype‘string‘.由讯客互联电脑硬件栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“Property‘startsWith‘doesnotexistontype‘string‘.”
上一篇
MySQL常用数据类型