I have been trying to install yo to integrate and test botkit but had issues with yo and npm and node as I updated brew on my mac to the latest. Here is how I resolved it.
1 Answers
If you have installed latest node 12 on your mac using latest update of homebrew(if you haven't updated and want to, please update brew by running brew update and run brew install node).
Run the following commands to verify node and npm are updated to 12 and 6.9.0
[keshav@xxxxxx-mbp ~ ]$node -v v12.1.0
[keshav@xxxxxx-mbp ~ ]npm -v 6.9.0
If this is what you see on your console, you are good to proceed to next steps.If not, please add a comment if you are facing a error.
Run the following commands
- echo export PATH="$HOME/npm/bin:$PATH" >> ~/.zshrc
- npm config set prefix ~/npm
- echo "export NODE_PATH=$NODE_PATH:/home/$USER/npm/lib/node_modules" >> ~/.zshrc && source ~/.zshrc
- npm install -y -g yo
Once you run the command in step 4, you should see the below output in the console.
Output of command 4
npm install -y -g yo npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead /Users/xx/npm/bin/yo-complete -> /Users/xx/npm/lib/node_modules/yo/lib/completion/index.js /Users/xx/npm/bin/yo -> /Users/xx/npm/lib/node_modules/yo/lib/cli.js
yo@2.0.6 postinstall /Users/xx/npm/lib/node_modules/yo yodoctor
Yeoman Doctor Running sanity checks on your system
✔ Global configuration file is valid ✔ Node.js version ✔ No .bowerrc file in home directory ✔ No .yo-rc.json file in home directory ✔ npm version ✔ NODE_PATH matches the npm root ✔ yo version
Everything looks all right! + yo@2.0.6 updated 1 package in 5.752s

- 23
- 6