'npm ERR! arg Argument starts with non-ascii dash, this is probably invalid: [ '- g', 'appium' ]

when i try to Installing Appium Open Command Prompt/Terminal and type the following command to install Appium:

npm install –g appium

showing

npm ERR! arg Argument starts with non-ascii dash, this is probably invalid: [ '- g', 'appium' ] npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name "-g": Tags may not have any characters that encodeURIC omponent encodes.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\vipin\AppData\Roaming\npm-cache_logs\2018-08-23T07_34_08_ 495Z-debug.log

NB:- Node.js v8.11.4 and npm 5.6.0



Solution 1:[1]

I guess your –g is not a valid character. I also guess you are copy pasting the below command from somewhere,

npm install –g appium

Please try entering the same command manually in your CMD prompt/console as below,

npm install -g appium

Solution 2:[2]

I had the same issue. I have saved the installation instructions on a word document and the Word's '-' is not the right character. Replace the '-' in the command line and should be fixed.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zoe stands with Ukraine
Solution 2 Tomer Madmon