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(runnode --versionin your terminal) -
npm version:
6.1.0(runnpm --versionin your terminal) -
Version of yo :
2.0.4(runyo --versionin 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
> [email protected] 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 :(
+ [email protected]
updated 1 package in 10.616s
Did you try:
npm install -g yo@latest
or
npm rm -g yo
npm install -g yo
These both continue to fail. I can install it locally though. npm install yo doesn't fail.
I ran into this issue too with 8.11.3 version of Node.js on Windows. I downgraded to 8.0.0 version and it fixed the issue.
+1 to tinaschrepfer. I'm hitting this issue on Windows Server 2016 & Node.js 8.11.3.
Tried both "npm install -g yo@latest" and "npm rm -g yo", "npm install -g yo" but it didn't help.
D:\temp\vsext>npm install -g yo
C:\Users\sakono\AppData\Roaming\npm\yo -> C:\Users\sakono\AppData\Roaming\npm\node_modules\yo\lib\cli.js
C:\Users\sakono\AppData\Roaming\npm\yo-complete -> C:\Users\sakono\AppData\Roaming\npm\node_modules\yo\lib\completion\index.js
npm WARN lifecycle The node binary used for scripts is C:\GITCF\node.exe but npm is using C:\Program Files\nodejs\node.exe itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> [email protected] postinstall C:\Users\sakono\AppData\Roaming\npm\node_modules\yo\node_modules\spawn-sync
> node postinstall
> [email protected] postinstall C:\Users\sakono\AppData\Roaming\npm\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 :(
+ [email protected]
added 625 packages from 267 contributors in 33.362s
D:\temp\vsext>
Very old version of Node was unexpectedly in my path. Removing it fixed the issue.
Running into the same issue:

Please fix or at least update instructions because npm install -g yo@latest doesn't resolve the issue. Uninstalling and re-installing the package didn't address the issue either.
Are the following paths relatively the same? (bash commands, translate them to other shells if needed)
npm list -g | head -n 1
which yo
For example, I get:
/Users/username/.nvm/versions/node/v10.5.0/lib
/Users/username/.nvm/versions/node/v10.5.0/bin/yo
And the version check runs OK.
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 can you give us more details? What was the prefix path - what was at this path? Was it empty/non-existing?
@ydogandjiev Your solution worked for me.
could you give me detail about the solution, I have the same problem, and I'm new in linux Thank you so much
I have this same problem but there's nothing in my local .npmrc except proxy info.
λ npm install -g yo@latest C:\Users<XXXXXXX>\AppData\Roaming\npm\yo -> C:\Users<XXXXXXX>\AppData\Roaming\npm\node_modules\yo\lib\cli.js C:\Users<XXXXXXX>\AppData\Roaming\npm\yo-complete -> C:\Users<XXXXXXX>\AppData\Roaming\npm\node_modules\yo\lib\completion\index.js
[email protected] postinstall C:\Users<XXXXXXX>\AppData\Roaming\npm\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
Your yo version is outdated.
Upgrade to the latest version by running: npm install -g yo@latest
Found potential issues on your machine :(
- [email protected] updated 1 package in 17.983s
@aaronhawryluk please refer to #589 if you think your proxy is causing this issue
@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.
In my case I need the prefix on my mac os sytem or i can't install any package globaly .. https://johnpapa.net/node-and-npm-without-sudo/ So in both case (with or witheout prefix) i can't install it any suggestions ?
Edit : My bad yo is installed but I just can't pass the "sanity checks"
@msitruk you could try using nvm - it handles prefix automatically and does pass the yo check on my side.
Also, if anyone want to dig into why this issue started happening recently. You might want to review https://github.com/yeoman/doctor/blob/8692a7189a81983e085f75d4bc62d9bccc2615fa/lib/rules/yo-version.js (the high level code is pretty simple)
It could be a few things:
- Maybe there's bug in old version of the latest-version library. We can try bumping to latest.
- Any chance you're having 2 version of yo installed on your computer? One coming from an old version of node/npm for example?
And also, keep in mind yo still gets installed. These are warnings.
Found my issue. This is proxy-related but not an actual proxy issue. I have to put my user name and password for the proxy into my HTTP_PROXY system variable (it's an authenticating proxy), and it turns out that now that value needs to be encoded since it has special characters. So just changed any special characters in the proxy environment variable to %XX, and now it works perfectly. This wasn't necessary for some reason with older versions, but things change I guess. shrug
I am getting the same issue on Windows 7. I am not certain where to find the .npmrc file mentioned on this thread on windows. Nothing I can see on c: drive.
Any suggestions on how to fix this on Windows?
Thanks @ydogandjiev, your solution worked for me too!
Hello, I seem t be having the exact same issue. Can please someone assist? Node Version: 8.11.3 + NPM Version 5.6.0 Express Version : 4.16.3 Mongodb + Shell / Versions: 4.0.2 Grunt Version: 1.0.3 Debug version: 4.00 Git version: 2.18
c:\>npm install -g yo npm WARN deprecated [email protected]: debugversions 3.2.0-3.2.2 break Node 4. Users of node LTS and onward (modern Node versions): please upgrade todebug@4or above as soon as possible. Node 4 users: please pin todebug@>=3.2.3 <4` as it will be the last version range that supports Node@4.
[ .........] / extract:chalk: sill pacote trying registry-auth-token@https://registry.npmjs.org/registry-auth-token/-/regist[ .........] / extract:string-width: sill pacote trying strip-indent@https://registry.npmjs.org/strip-indent/-/strip-i
C:-----------\AppData\Roaming\npm\yo-complete ->
C:-----------\AppData\Roaming\npm\node_modules\yo\lib\completion\index.js
C:-----------\AppData\Roaming\npm\yo -> C:-----------\AppData\Roaming\npm\node_modules\yo\lib\cli.js
[email protected] postinstall C:-----------\AppData\Roaming\npm\node_modules\yo\node_modules\spawn-sync node postinstall
[email protected] postinstall C:-----------\AppData\Roaming\npm\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 :(
- [email protected] added 535 packages in 131.331s
c:>npm install -g yo@latest
npm WARN deprecated [email protected]: debug versions 3.2.0-3.2.2 break Node 4. Users of node LTS and onward (modern Node versions): please upgrade to debug@4 or above as soon as possible. Node 4 users: please pin to debug@>=3.2.3 <4 as it will be the last version range that supports Node@4.
C:-----------\AppData\Roaming\npm\yo-complete ->
C:-----------\AppData\Roaming\npm\node_modules\yo\lib\completion\index.js
C:-----------\AppData\Roaming\npm\yo ->
C:-----------\AppData\Roaming\npm\node_modules\yo\lib\cli.js
[email protected] postinstall C:-----------\AppData\Roaming\npm\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 :(
- [email protected] updated 1 package in 11.132s
c:>yo --version 'yo' is not recognized as an internal or external command, operable program or batch file.
c:>yo --version 'yo' is not recognized as an internal or external command, operable program or batch file.
c:>git --version 'git' is not recognized as an internal or external command, operable program or batch file.
c:>npm i debug npm WARN saveError ENOENT: no such file or directory, open 'c:\package.json' npm WARN enoent ENOENT: no such file or directory, open 'c:\package.json' npm WARN !invalid#1 No description npm WARN !invalid#1 No repository field. npm WARN !invalid#1 No README data npm WARN !invalid#1 No license field.
- [email protected] added 5 packages and updated 1 package in 3.274s
c:>mpm install -g yo 'mpm' is not recognized as an internal or external command, operable program or batch file.
c:>npm install -g yo
npm WARN deprecated [email protected]: debug versions 3.2.0-3.2.2 break Node 4. Users of node LTS and onward (modern Node versions): please upgrade to debug@4 or above as soon as possible. Node 4 users: please pin to debug@>=3.2.3 <4 as it will be the last version range that supports Node@4.
C:\Users\247UNITEDHUB\AppData\Roaming\npm\yo -> C:\Users\247UNITEDHUB\AppData\Roaming\npm\node_modules\yo\lib\cli.js
C:\Users\247UNITEDHUB\AppData\Roaming\npm\yo-complete -> C:\Users\247UNITEDHUB\AppData\Roaming\npm\node_modules\yo\lib\completion\index.js
[email protected] postinstall C:\Users\247UNITEDHUB\AppData\Roaming\npm\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 :(
- [email protected] updated 1 package in 19.577s
Been using the Windows CMD to do this on Windows 10 `
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
I followed the steps on this page - 'How to Prevent Permissions Errors' https://docs.npmjs.com/getting-started/fixing-npm-permissions and it fixed the problem for me
@ydogandjiev your solution help me.
I had the same issue, but I ran mine in a PowerShell window from within VS Code (I always do). After I ran VS Code as Administrator permission, I was able to run the upgrade successfully.
These both continue to fail. I can install it locally though.
npm install yodoesn't fail.
but it does not fix the problem while using command like "yo -v". So how to fix it totally
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.
If you are mac user, so first of all you have to show hidden files using this command in your terminal > defaults write com.apple.Finder AppleShowAllFiles YES After you need open HOME folder ( white home with triangle roof ) and find there file .npmrc and open it. Inside you will see this text prefix$~/.npm-global and just delete prefix$~/. this part so now you have only npm-global That's work for me :) ydogandjiev thank you a lot!
@Lamoreauxaj Thanks,, working at Linux Mint with npm install yo

@xhafid your above solutions works for thanks
@ydogandjiev It works!Thank you so much
file path(Windows 10):
C:\Users\UserName\.npmrc
