yo: Unable to install yo through npm because "Your yo version is outdated"

Type of issue

Bug


My environment

  • OS version/details: Ubuntu 18.04
  • Node version: 10.5.0 (run node --version in your terminal)
  • npm version: 6.1.0 (run npm --version in your terminal)
  • Version of yo : 2.0.4 (run yo --version in your terminal)

Expected behavior

Running npm install yo -g always fails on yo doctor. I would expect it to successfully install.

Current behavior

Installing yo always fails with “Your yo version is outdated”. This prevents the install from succeeding and therefore I am unable to use the package globally.

Steps to reproduce the behavior

Run npm install yo -g and it fails on my system.

Command line output

lamoreauxaj@lamoreauxaj:~$ npm install yo -g
/opt/node-v8/lib/node_modules/node/bin/yo -> /opt/node-v8/lib/node_modules/node/lib/node_modules/yo/lib/cli.js
/opt/node-v8/lib/node_modules/node/bin/yo-complete -> /opt/node-v8/lib/node_modules/node/lib/node_modules/yo/lib/completion/index.js

> yo@2.0.4 postinstall /opt/node-v8/lib/node_modules/node/lib/node_modules/yo
> yodoctor


Yeoman Doctor
Running sanity checks on your system

✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ Node.js version
✔ No .bowerrc file in home directory
✔ No .yo-rc.json file in home directory
✖ yo version

Your yo version is outdated.

Upgrade to the latest version by running:
npm install -g yo@latest

✔ npm version

Found potential issues on your machine :(
+ yo@2.0.4
updated 1 package in 10.616s

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 9
  • Comments: 43 (6 by maintainers)

Most upvoted comments

The issue I encountered was caused by a bad prefix value in my .npmrc file which was pointing to a non-existent version of Node. I still have no idea what tool set that but it completely busted my ability to globally install npm packages. Removing the prefix from my .npmrc file resolves the issue. This might be something the Yeomen Doctor could be taught to detect.

@ydogandjiev thanks for the solution.

Regarding the details --> open .npmrc file (Hidden file inside HOME in mac or C: in Windows) and delete the ‘PREFIX’ parameter written in it.

These both continue to fail. I can install it locally though. npm install yo doesn’t fail.

@Lamoreauxaj Thanks, working at Linux Mint with npm install yo screenshot from 2018-12-11 11-15-00

Did you try:

npm install -g yo@latest

or

npm rm -g yo
npm install -g yo

Thank you for the help. It worked – removing “prefix=${APPDATA}\npm” node version - 10.2.1 npm version - 5.6.0 Windows 10 File location - “C:\Program Files\nodejs\node_modules\npm”

I was having the same problem in Linux … × yo version Found potential issues on your machine 😦

I had used sudo npm install -g yo@latest and it worked fine… try it out

@aaronhawryluk please refer to #589 if you think your proxy is causing this issue

could you give me detail about the solution, I have the same problem, and I’m new in linux Thank you so much

@ydogandjiev Your solution worked for me.

@ydogandjiev can you give us more details? What was the prefix path - what was at this path? Was it empty/non-existing?