angularjs - 使用 typings 安装 es6-promise

标签 angularjs typescript es6-promise

我正在阅读这篇关于 Angular 2 的文章 - https://semaphoreci.com/community/tutorials/setting-up-angular-2-with-webpack * 以上文章适用于 Angular 2 RC5。

一切顺利,直到我们开始执行这一行——使用 typescript (typings) 安装 es6-promise: ./node_modules/.bin/typings 安装 es6-promise --save

在终端中执行这一行会抛出以下错误:

typings WARN hastypings “es6-promise”的类型已经存在于“node_modules/es6-promise/es6-promise.d.ts”中。你应该让 TypeScript 解析打包的 typings 并卸载由 Typings 安装的副本 打字错误!消息无法在注册表中找到“es6-promise”(“npm”)。 打字错误! message 但是,我们发现了其他 2 个来源的“es6-promise”:“common”和“dt”

最佳答案

看起来您已经为模块安装了类型,因此无需手动执行。尝试跳过这一步 - ./node_modules/.bin/typings install es6-promise --save

关于angularjs - 使用 typings 安装 es6-promise,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40014383/

相关文章:

javascript - 当 promise 没有任何返回时怎么办?

javascript - ASP.NET 中的 SignalR 和 Angular,客户端没有得到响应

html - 单击时如何使用 CSS 和/或 Angular 将 DIV 移动到中心?

javascript - 从 Angular 的表单组中删除特定的验证器

typescript - 在不同类型检查 (tsconfig) 上创建编译器错误

javascript - promise : some problems with reject

javascript - Angular 从 $http 请求获取数据给出未定义

javascript - Angular : How can we broadcast promise to different controllers?

typescript - 有没有办法在类上放置静态枚举?

javascript - 如何将参数作为 Promise 链中 then() 的参数传递给函数,并保留先前解析的值?