yeoman / doctor

Detect potential issues with users system that could prevent Yeoman from working correctly
http://yeoman.io
BSD 2-Clause "Simplified" License
61 stars 17 forks source link

Add --silent to npm root -g to avoid error when loglevel is above warn #9

Closed j3lte closed 9 years ago

j3lte commented 9 years ago

I have had problems when installing yo and this is due to the fact that yodoctor will run

npm -g root

without checking if the loglevel is above warn. So in my case, loglevel is always at info, and this creates unnecessary errors.

[Yeoman Doctor] Uh oh, I found potential errors on your machine
---------------

[Error] npm root value is not in your NODE_PATH
  [info]
    NODE_PATH = /home/jelte/.nvm/v0.10.33/lib/node_modules
    npm root  = npm info it worked if it ends with ok
npm info using npm@2.1.9
npm info using node@v0.10.33
/home/j3lte/.nvm/v0.10.33/lib/node_modules
npm info ok

  [Fix] Append the npm root value to your NODE_PATH variable
    Add this line to your .bashrc
      export NODE_PATH=$NODE_PATH:npm info it worked if it ends with ok
npm info using npm@2.1.9
npm info using node@v0.10.33
/home/j3lte/.nvm/v0.10.33/lib/node_modules
npm info ok
    Or run this command
      echo "export NODE_PATH=$NODE_PATH:npm info it worked if it ends with ok
npm info using npm@2.1.9
npm info using node@v0.10.33
/home/j3lte/.nvm/v0.10.33/lib/node_modules
npm info ok" >> ~/.bashrc && source ~/.bashrc

In order to circumvent this, I propose adding the --silent argument to this argument.

SBoudrias commented 9 years ago

Thanks! Nice fix!