VS Code 更新到 1.2.x 以后(包括最新的1.3.0版本),其中内置的 TypeScript 驱动程序会造成对打开项目中的文件死锁,导致如果在 Creator 编辑器和 VS Code 同时打开一个项目时如果进行构建,会出现:
Build Failed: Error: EPERM: operation not permitted, rename 'xxx\build\tempCocosProject' -> 'xxx\build\jsb-binary'
这样的报错。
除了等待捆绑了 TypeScript 2.0 的 VS Code 正式发布以外,遇到问题的同学可以通过手动更新 TypeScript 到新版本来解决,详情请阅读下面的说明:
https://github.com/Microsoft/vscode/issues/7492
安装最新版本 TypeScript 的方法:
https://code.visualstudio.com/docs/languages/typescript#_using-newer-typescript-versions
成功下载新版本的 TypeScript 之后,要在 VS Code 的用户设置(User Settings)文件里添加以下字段:
"typescript.tsdk": "path/to/typescript"
注意在 windows 环境下要注意路径分割需要用 \\ 双反斜杠:
"typescript.tsdk": "C:\\Users\\nantas\\fireball-x\\ts\\node_modules\\typescript\\lib"
,沙发!