环境标志已弃用

时间:2016-06-14 09:50:33

标签: angularjs node.js selenium ionic2 e2e-testing

我正在尝试在我的应用程序中安装依赖项我得到错误的环境标志已经折旧,并且终端说要用--global替换它我完成了它但现在终端说"无法找到"节点" (" npm")在注册表中#34;。我按照此链接进行了e2e测试http://lathonez.github.io/2016/ionic-2-e2e-testing/

yokeshs-Mac-mini:easycloud yokesh$ sudo typings install express --save --ambient
typings ERR! deprecated The "ambient" flag is deprecated. Please use "global" instead
yokeshs-Mac-mini:easycloud yokesh$ sudo typings install --global --save angular-protractor jasmine node selenium-webdriver
typings ERR! message Unable to find "node" ("npm") in the registry. Did you want to try searching another source? Also, if you want contribute these typings, please help us: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/node/versions/latest responded with 404, expected it to equal 200

typings ERR! cwd /Users/yokesh/easycloud
typings ERR! system Darwin 15.5.0
typings ERR! command "/usr/local/bin/node" "/usr/local/bin/typings" "install" "--global" "--save" "angular-protractor" "jasmine" "node" "selenium-webdriver"
typings ERR! node -v v4.4.3
typings ERR! typings -v 1.1.0

typings ERR! If you need help, you may report this error at:
typings ERR!   <https://github.com/typings/typings/issues>
yokeshs-Mac-mini:easycloud yokesh$ 

我只想知道如何安装此命令&#34; typings install --ambient --save angular-protractor jasmine node selenium-webdriver&#34;

1 个答案:

答案 0 :(得分:4)

从版本1.0开始,TypeScript Definition Manager进行了一些更新(see here),其中包括弃用--ambient标记。

  
      
  • 环境的用法现在是全球性的      
        
    • 这意味着typings.json任何ambientDependencies都应重命名为globalDependencies,任何ambientDevDependencies应该是   重命名为globalDevDependencies
    •   
    • 这也意味着--ambient现在是--global
    •   
  •   

引用GitHub页面上的Quick Start example,您需要做的是显式引用安装类型定义的注册表,以便Typings知道在哪里查找它。

示例(Windows CLI)

通过搜索找到包

typings search *name*

然后从命令行(源列)

中的打印结果表中获取源代码
| NAME | SOURCE | HOMEPAGE | DESCRIPTION | VERSIONS | UPDATED |
|--------------------------------------------------------------
|      |        |          |             |          |         |
|      |        |          |             |          |         |

在此示例中,您要安装的每个包都返回源dt。在我的安装命令中,我现在必须明确告诉typings安装来自dtDefinitelyTyped)的每个包。

typings install --global --save dt~angular-protractor dt~jasmine dt~node dt~selenium-webdriver