tj / n

Node version management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/usr/local vs. /usr/local/bin

jgedri opened this issue · comments

Problem

Short Version

n is in /usr/local/bin but wants a file in /usr/local

Long Version

I installed n in my home directory, ran into permission issues, removed it and reinstalled from this repo. I'm getting the error find: ‘/usr/local/n/versions’: No such file or directory

The first install was via n-install; the second, I cloned the repo and ran sudo make install.

Configuration Details

$ n --version
?
v9.1.0
$ command -v node
?
/usr/bin/node
$ node -p process.platform
?
linux

Where you install n and where n installs node are two different things.

To change where n installs node from the default of /usr/local, use N_PREFIX.

If you install to the default root of /usr/local, there are a few folders that you need write access to. You could use sudo when you change node versions, but what I suggest is taking ownership of the relevant folders. See the README for more: https://github.com/tj/n#installation

The downloaded node versions are stored in /usr/local/n/versions by default and that is the folder you saw in the error message.

An answer was provided, and no further activity in a month. Closing this as resolved.

Feel free to open a new issue if it comes up again, with new information and renewed interest.