0

I have mac and was trying to install Alexa cli with below command:

sudo npm install -g ask-cli

My installation was showing successful but it was giving me below error on ask --version :

-bash: ask: command not found

I am using node version > 12

Can any one help ?

Anand_5050
  • 1,019
  • 2
  • 10
  • 23

3 Answers3

0

I googled lot but could not found the answer. Got frustrated. So finally thought of putting.

I have mac and was trying to install Alexa cli with below command:

sudo npm install -g ask-cli

My installation was showing successful but it was giving me below error on ask --version :

-bash: ask: command not found

I was using node version > 12

Finally after almost 6 hours of RnD i could solve this error by downgrading node to version 8

Below are the detailes what i did:

THis was my prev version which was giving error

Anands-MacBook-Air:~ anand$ node -v v13.6.0

How to downgrade to lower version of node :

Anands-MacBook-Air:~ anand$ sudo npm cache clean -f

npm WARN using --force I sure hope you know what you are doing.

Anands-MacBook-Air:~ anand$ sudo npm install -g n

/usr/local/bin/n -> /usr/local/lib/node_modules/n/bin/n + n@6.1.3

updated 1 package in 27.206s

Anands-MacBook-Air:~ anand$ sudo n 8 5.8

installing : node-v8.17.0 mkdir : /usr/local/n/versions/node/8.17.0 fetch : https://nodejs.org/dist/v8.17.0/node-v8.17.0-darwin-x64.tar.gz installed : v8.17.0 (with npm 6.13.4)

Anands-MacBook-Air:~ anand$ node -v

v8.17.0

Then did below :

Anands-MacBook-Air:~ anand$ sudo npm install -g ask-cli

Anands-MacBook-Air:~ anand$ ask --version

1.7.22

Anands-MacBook-Air:~ anand$

Hope it will help someone.

Anand_5050
  • 1,019
  • 2
  • 10
  • 23
0

If you use nvm, you might need to install it on your current Node.js version.

0

Exiting out of the terminal session and opening up a new terminal session solved this for me on MacOS.

eebbesen
  • 5,070
  • 8
  • 48
  • 70