安装Node.js
创建一个空文件夹,为了生成Node.js package.json文件,运行npm init
安装TS编译器
npm install -g typescript
tsc执行报错tsc : 无法加载文件,因为在此系统上禁止运行脚本,
所以要先执行命令
set-ExecutionPolicy RemoteSigned
然后tsc就可以用了
tsc .\Test.ts
就会生成Test.js
然后node .\Test.js就能出运行结果
Cocos2d creator里报错process is not defined
C:\Users\Administrator\ts-rpc-cocos-creator38-demo\node_modules\util\util.js
必须找到这个注释掉,搞了好几个小时,否则报错process is not defined
//if (process.env.NODE_DEBUG) {
// var debugEnv = process.env.NODE_DEBUG;
// debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&')
// .replace(/\*/g, '.*')
// .replace(/,/g, '$|^')
// .toUpperCase();
// debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');
//}