学无止尽

你的博客名称

你的一句话介绍

【TypeScript】WebStorm使用ts遇到的坑

- windows cmd下使用npm安装TypeScript报错

需要更换国内镜像
npm config set registry https://registry.npmmirror.com
然后在安装TypeScript
npm install -g typescript

- WebStorm使用运行ts格式文件

不需要额外的配置,只需要安装插件“Run Configuration for TypeScript”即可
Run Configuration for TypeScript
运行应用

- Error: Cannot find module 'ts-node/register'

安装ts-node
npm install -g ts-node

- error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the 'lib' compiler option to include 'dom'.

安装@types/node
npm install -g @types/node

posted @ 2022-05-07 11:06  5055555  阅读(1608)  评论(0)    收藏  举报