使用 typings 安装 es6-promise
Installing es6-promise with typings
我在 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")。
打字错误!消息 但是,我们发现 "es6-promise" 用于其他 2 个来源:"common" 和 "dt"
看起来您已经为模块安装了类型,因此无需手动进行。尝试跳过这一步 - ./node_modules/.bin/typings install es6-promise --save
这对你有用:
./node_modules/.bin/typings 安装 es6-promise --source dt --save
它将为您从 DefinitelyTyped 导入请求的文件。
我刚遇到同样的问题
命令已更改为:
typings install dt~es6-shim --save --global
您可以查看此github问题以供参考:
Unable to install es6 Shim or registry:env/meteor
由于 typings
存储库为 deprecated,您现在可以使用以下命令:
npm install @types/es6-shim --save
我在 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")。 打字错误!消息 但是,我们发现 "es6-promise" 用于其他 2 个来源:"common" 和 "dt"
看起来您已经为模块安装了类型,因此无需手动进行。尝试跳过这一步 - ./node_modules/.bin/typings install es6-promise --save
这对你有用:
./node_modules/.bin/typings 安装 es6-promise --source dt --save
它将为您从 DefinitelyTyped 导入请求的文件。
我刚遇到同样的问题 命令已更改为:
typings install dt~es6-shim --save --global
您可以查看此github问题以供参考: Unable to install es6 Shim or registry:env/meteor
由于 typings
存储库为 deprecated,您现在可以使用以下命令:
npm install @types/es6-shim --save