全局安装typescript ```npm install typescript -g``` 在vscode ctrl+shift+b生成launch.json,删掉无用的部分,只保留下面内容 ``` {             "type": "node",             "request": "attach",             "name": "Attach",             "port": 8081,             "sourceMaps": true,             "skipFiles": [                 "/**"             ],         } ``` 特别注意: 编辑器设置中的默认端口8080是给puerts给编辑器开的虚拟机,我们在gameinstance里面写的不是同一个虚拟机。这里要换一个端口,用8081,GameInstance里面也用8081 参考 https://github.com/Tencent/puerts/issues/993