首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >角2提前编译器错误

角2提前编译器错误
EN

Stack Overflow用户
提问于 2016-09-06 05:32:38
回答 1查看 1.3K关注 0票数 1

我在Windows 7 x64上,试着遵循我的Range2应用程序的提前编译指令。该应用程序编译和运行良好,只要及时编译。

我安装了@angular/compiler-cli@0.6.0typescript@2.0.2@angular/platform-server@2.0.0-rc.6@angular/compiler@2.0.0-rc.6

运行ngc时会出现以下错误

代码语言:javascript
运行
复制
C:\websites\learn\angular2>"node_modules/.bin/ngc" -p dev
can't resolve module @angular/core/src/di/opaque_token from C:\...\dev\index.ts
TypeError: undefined is not a function
    at ReflectorHost.findDeclaration (C:\...\node_modules\@angular\compiler-cli\src\reflector_host.js:171:59)
    at StaticReflector.initializeConversionMap (C:\...\node_modules\@angular\compiler-cli\src\static_reflector.js:150:38)
    at new StaticReflector (C:\...\node_modules\@angular\compiler-cli\src\static_reflector.js:42:14)
    at Function.CodeGenerator.create (C:\...\node_modules\@angular\compiler-cli\src\codegen.js:142:31)
    at codegen (C:\...\node_modules\@angular\compiler-cli\src\main.js:7:36)
    at Object.main (C:\...\node_modules\@angular\tsc-wrapped\src\main.js:30:16)
    at Object.<anonymous> (C:\...\node_modules\@angular\compiler-cli\src\main.js:14:9)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
Compilation failed

下面是我的文件夹结构(tsconfig.json位于顶层的angular2中):

乍一看,这个错误似乎是类似于这个,但是仔细看看就会发现,我的错误(“未定义不是函数”)是不同的。有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2016-09-06 23:37:01

这与我安装的节点版本有关。

代码语言:javascript
运行
复制
$ node --version
v0.12.7

$ npm --version
3.7.5

在我从https://nodejs.org/en/download/下载并安装了最新的64位https://nodejs.org/en/download/安装程序之后

代码语言:javascript
运行
复制
$ node --version
v4.5.0

$ npm --version
2.15.9

错误不再发生。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39341276

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档