Error PATH? NODE NPM! install but can not find it when executing

0

Hi, I have a big problem with mac osX

I have installed node 6.5.0; npm 3.10.3

and when installing any dependency such as bower, install it in a hidden folder on my desktop:

The problem in the case of bower is that when wanting to execute it, it does not recognize it.

and re install 2 times no deleting their directories but this impasse still persists

another example:

sudo npm -g install -g yo:

and when executing it returns to show command not found!:

How do I solve it? Will it be the path ?, please.

    
asked by Hernan Humaña 14.09.2016 в 18:15
source

2 answers

1

Check if the folder where you install nod has administrator permissions, normally node.js is installed in the /usr/local/bin/node folder. And also make sure you add $PATH in your /usr/local/bin .

    
answered by 14.09.2016 в 18:44
0

Change the prefix that npm uses to install packages so that they are in /usr/local/lib/node_modules (as they normally do) and not in /Users/Usuario/.npm-packages .

To change it you can use: npm config set prefix /usr/local

    
answered by 14.09.2016 в 18:41