2

I tried to install the npm install pug, could not because of the permisions, got this:

checkPermissions Missing write access to /usr/local/lib/node_modules

However im logged in as as root Linards:~ Berzins$, as I tried to enable the root user:

Linards:~ Berzins$ dsenableroot
username = Berzins
user password:
root password:
verify root password:
dsenableroot:: ***Successfully enabled root user.

Any help appreciated.

UPDATE:

After suggestion by FarazX below, this is the ooutcome:

Linards:~ Berzins$ ls -lO /usr/local/lib/node_modules
total 0
drwxr-xr-x   8 Berzins  staff  - 272  1 Oct 21:53 bower
drwxr-xr-x   8 Berzins  staff  - 272  1 Oct 21:54 foundation-cli
drwxr-xr-x  12 Berzins  staff  - 408 11 Oct 22:56 gulp
drwxr-xr-x  27 Berzins  staff  - 918 12 Oct 13:17 npm
Linards:~ Berzins$

1 Answers1

-1

Try

sudo chown -R $USER /usr/local`

This should grant enough permissions for your current user.

  • This solution is bad practice on how to install applications. The question is also incomplete as it indicates that the poster his current directory is `/usr/local/lib` when running `npm`. By default, npm builds a per-project `node_modules` directory. – hspaans Aug 04 '20 at 23:47