Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/430.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 试图编译;分区js“;作为一个外部模块,但它看起来像一个全局模块_Javascript_Node.js_Typescript_Angular - Fatal编程技术网

Javascript 试图编译;分区js“;作为一个外部模块,但它看起来像一个全局模块

Javascript 试图编译;分区js“;作为一个外部模块,但它看起来像一个全局模块,javascript,node.js,typescript,angular,Javascript,Node.js,Typescript,Angular,我有“AngularClass”angular2网页包入门项目 我已经安装了所有npm依赖项 现在我正试图安装打字机 typings.json { "dependencies": { "zone.js": "github:gdi2290/typed-zone.js#66ea8a3451542bb7798369306840e46be1d6ec89" }, "devDependencies": {}, "ambientDependencies": { "angular

我有“AngularClass”angular2网页包入门项目 我已经安装了所有npm依赖项 现在我正试图安装打字机

typings.json

{
  "dependencies": {
    "zone.js": "github:gdi2290/typed-zone.js#66ea8a3451542bb7798369306840e46be1d6ec89"
  },
  "devDependencies": {},
  "ambientDependencies": {
    "angular-protractor": "github:DefinitelyTyped/DefinitelyTyped/angular-protractor/angular-protractor.d.ts#64b25f63f0ec821040a5d3e049a976865062ed9d",
    "core-js": "registry:dt/core-js#0.0.0+20160317120654",
    "hammerjs": "github:DefinitelyTyped/DefinitelyTyped/hammerjs/hammerjs.d.ts#74a4dfc1bc2dfadec47b8aae953b28546cb9c6b7",
    "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#4b36b94d5910aa8a4d20bdcd5bd1f9ae6ad18d3c",
    "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#8cf8164641be73e8f1e652c2a5b967c7210b6729",
    "selenium-webdriver": "github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#a83677ed13add14c2ab06c7325d182d0ba2784ea",
    "webpack": "github:DefinitelyTyped/DefinitelyTyped/webpack/webpack.d.ts#95c02169ba8fa58ac1092422efbd2e3174a206f4"
  }
}
我打字的时候

sudo typings install
我得到

derzunov:angular2网页包启动程序derzunov$sudo typings安装
打字错误!消息试图将“zone.js”编译为外部模块,但它看起来像一个全局模块。
打字错误!cwd/Users/derzunov/projects/Angular2/Angular2网页包初学者
打字错误!达尔文系统15.4.0
打字错误!命令“/usr/local/bin/node”“/usr/local/bin/typings”“安装”
打字错误!节点-v4.4.4
打字错误!打字-V1.0.2
打字错误!如果需要帮助,您可以在以下位置报告此错误:
打字错误!
这是什么意思?
救命

Typings 1.0.x有一些缺陷。将“zone.js”放入“ambientDependencies”部分,并将其重命名为“globalDependencies”

我怀疑它需要
-g
进行全局安装<代码>sudo安装-g打字@SterlingArcher:No;这是一个有角度的预编译程序。@SLaks我做错了什么?项目链接-
typings(npm安装-全局typings)
这对你有用吗?我也有同样的问题,按照上面的说明修改typings.json文件解决了我的问题。对我也有用。即使许多其他行处于ambientDependencies下,也不要害怕进行更改。
derzunov:angular2-webpack-starter derzunov$ sudo typings install
typings ERR! message Attempted to compile "zone.js" as an external module, but it looks like a global module.

typings ERR! cwd /Users/derzunov/projects/Angular2/angular2-webpack-starter
typings ERR! system Darwin 15.4.0
typings ERR! command "/usr/local/bin/node" "/usr/local/bin/typings" "install"
typings ERR! node -v v4.4.4
typings ERR! typings -v 1.0.2

typings ERR! If you need help, you may report this error at:
typings ERR!   <https://github.com/typings/typings/issues>