Environment flag out of date

I try to establish a dependency in my application, I get err that the ambient flag is depreciating, and also the terminal says to replace it with -global i, but now the terminal says "Cannot find" node "(" npm ") in the registry " I followed this link to do e2e testing http://lathonez.imtqy.com/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$ 

I just wanted to know how to install this command: typings install --ambient --save angular -protractor jasmine node selenium-webdriver "

+4
source share
1 answer

Starting with version 1.0 of TypeScript, the Definition Manager has made some updates ( see here ), which included the rejection of the --ambient flag.

  • Ambient use is now global
    • This means that in typings.json any ambientDependencies should be renamed globalDependencies , and any ambientDevDependencies should be renamed globalDevDependencies .
    • It also means that --ambient now --global

Referring to the Quick Launch Example on the GitHub page, you need to explicitly specify the registry in which you install the type definition (s) so that Tipitsa knows where to look for it.

Example (Windows CLI)

Find the package by searching

typings search *name*

Then get the source code from the print results table on the command line (source column)

 | NAME | SOURCE | HOMEPAGE | DESCRIPTION | VERSIONS | UPDATED | |-------------------------------------------------------------- | | | | | | | | | | | | | | 

In this example, every package you want to install returns with a dt source. In my installation command, I now have to clearly specify the types in order to install each package from dt ( DefinitelyTyped ).

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

+4
source

All Articles