Angular 2:AOT TypeError:base64不是函数

Din*_*hah 5 angularjs angular

我试图用aot编译我的项目,但是当我尝试命令时

ngc -p tsconfig-aot.json

它在第一次使用ngFactroy生成aot文件夹,但是当我更改主要ts(如角度文档中提到的)为bootstrap新生成的ngmodulefactory并使用相同的命令重新编译项目时,我得到以下错误

TypeError: base64 is not a function
at Function.from (native)
at Function.from (native)
at Object.extractInlineSourceMap (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/tsickle/build/src/source_map_utils.js:33:19)
at TsickleCompilerHost.stripAndStoreExistingSourceMap (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/tsickle/build/src/tsickle_compiler_host.js:128:48)
at TsickleCompilerHost.getSourceFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/tsickle/build/src/tsickle_compiler_host.js:89:25)
at findSourceFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63453:29)
at processImportedModules (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63600:25)
at findSourceFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63481:17)
at processSourceFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63384:27)
at processRootFile (/Users/apache-tomcat-7.0.61/webapps/ChatAppAngular/node_modules/typescript/lib/typescript.js:63271:13)
Compilation failed
Run Code Online (Sandbox Code Playgroud)

难道我做错了什么 ?

Din*_*hah 6

我找到答案,它的节点js在这里做问题,AOT需要节点js v6 +,我只是更新我的节点并发布修复,只是发布我的答案,如果有人面临这个问题.

  • 希望这会对某人有所帮助:http://stackoverflow.com/a/18412505/4472973 - 更新windows的节点js的最简单方法 (2认同)