adtac / climate

The swiss-army knife of utility tools for Linux.
GNU General Public License v3.0
1.42k stars 76 forks source link

support for nvm #16

Open lholznagel opened 7 years ago

lholznagel commented 7 years ago

Hey, I just tried to install this script. During the installation progress it showed me that npm is not installed. But I have npm installed using nvm (https://github.com/creationix/nvm) Running node -v and npm -v gives from both the version back.

Would be awesome if the script recognises this.

Have a nice day :)

adtac commented 7 years ago

Huh, that's weird. Can you try running type "npm" and post the output here? If it's empty, that'd explain this (but it shouldn't be empty however).

lholznagel commented 7 years ago

Ah, I looked yesterday into the code and tried to use type "npm". The result was empty.

But typing type pip was also empty, which was indicated as installed. But maybe this is because I forgot the quotes.

adtac commented 7 years ago

Can you try which pip and which npm? If those work, then I can change the command_exists function to use which if type doesn't return a result (but we'd still use type first because it's supposed to be faster).

lholznagel commented 7 years ago

On my Laptop both commands work. Will try later at home if it also works there.

lholznagel commented 7 years ago

Sorry for the long delay. Using which works on my home machine as well

adtac commented 7 years ago

neat, I'll make a patch soon :+1:

ghost commented 7 years ago

was this patch made? I faced similar problem today, getting • node missing. Installing... while node is installed through nvm

➜  ~ node -v      
v6.11.0
➜  ~ npm --version
5.0.4

➜  ~ type node
node is /home/pshkrjshnde/.nvm/versions/node/v6.11.0/bin/node
➜  ~ type npm
npm is /home/pshkrjshnde/.nvm/versions/node/v6.11.0/bin/npm

➜  ~ which node
/home/pshkrjshnde/.nvm/versions/node/v6.11.0/bin/node
➜  ~ which npm
/home/pshkrjshnde/.nvm/versions/node/v6.11.0/bin/npm