本文介绍了试图编译“zone.js”作为外部模块,但它看起来像一个全局模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有AngularClassangular2-webpack-starter项目
我已安装所有npm依赖项
现在我正在尝试安装打字
I have the "AngularClass" angular2-webpack-starter projectI have install all npm dependenciesNow I'm trying to install typings
typings.json
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-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>
这是什么意思?
帮助! =))
What does it mean?Help! =))
推荐答案
打字1.0.x有一些。将zone.js放入ambientDependencies部分并将其重命名为globalDependencies
Typings 1.0.x has some breaking changes. Put "zone.js" into "ambientDependencies" section and rename it to "globalDependencies"
这篇关于试图编译“zone.js”作为外部模块,但它看起来像一个全局模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!