Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Permission denied before running with sudo #416

@tiagomsmagalhaes

Description

@tiagomsmagalhaes

Issue Template:

Describe issue including what OS you are using

After installing n on macOS 10.12.3 and node 7.5.0 previously installed, I ran simply n and got "permission denied" issues along stating that I hadn't any version installed along the list of possible commands.

Then I ran one command with sudo and the "permission denied" issue disappeared.

Describe what version of N you have

2.1.4

Describe how you installed N

npm install -g n

Steps to reproduce issue 1.2.3

  1. install n for the first time
  2. run n
  3. get issue

Describe the results you received

permission denied for operations along with list of possible commands

Describe the results you expected

list of possible commands

What version of npm you are using

4.1.2

Additional information you deem important (e.g. issue happens only occasionally):

  • Output of which n: /usr/local/bin/n
  • Output of node -v: v7.5.0

(paste your output here)

tiago at Tiagos-MacBook-Pro in ~
$ n
mkdir: /usr/local/n/versions/node: Permission denied
mkdir: /usr/local/n/versions/io: Permission denied
find: /usr/local/n/versions: No such file or directory

  Error: no installed version


$ n -V
mkdir: /usr/local/n/versions/node: Permission denied
mkdir: /usr/local/n/versions/io: Permission denied
2.1.3

tiago at Tiagos-MacBook-Pro in ~
$ sudo n -V
Password:
2.1.3

tiago at Tiagos-MacBook-Pro in ~
$ node
> .exit

tiago at Tiagos-MacBook-Pro in ~
$ sudo n

  Error: no installed version

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions