Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EACCES: permission denied, mkdir '.../node_modules/libpq/build' #43

Open
poshest opened this issue May 19, 2016 · 6 comments
Open

EACCES: permission denied, mkdir '.../node_modules/libpq/build' #43

poshest opened this issue May 19, 2016 · 6 comments

Comments

@poshest
Copy link

poshest commented May 19, 2016

I'm getting this error when I do a pg-native install, on Ubuntu 12.04.

gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/vagrant/task/server/node_modules/libpq/build'
gyp ERR! stack     at Error (native)
gyp ERR! System Linux 3.2.0-23-generic-pae
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vagrant/task/server/node_modules/libpq
gyp ERR! node -v v6.2.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

It happens whether I sudo npm or not. It happens on node versions 0.11, 0.12, 4.3, 6.2. It happens if I manually create and chmod and chown the '/home/vagrant/task/server/node_modules/libpq/build' directory.

I have the following installed

  • gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
  • GNU Make 3.81
  • Python 2.7.3
  • PostgreSQL 9.3.10
  • node v6.2.0
  • node-gyp v3.3.1
  • npm v3.8.9

I have the latest libpq-dev, and pg_config is in my path.

I'd really love some help. I've Googled, installed, updated, chowned, chmoded, and nothing seems to fix it.

@rbudiharso
Copy link

over a year and no update on this? bummer

@OllieJennings
Copy link

Yeah i am still hitting this issue a lot

@stephendeo
Copy link

stephendeo commented Apr 2, 2018

ugh... just ran into this exact same issue today... =( I've tried reinstalling node, updating to the latest version in npm, clearing npm cache and directly calling npm from its global path /usr/local/lib/node/npm to install package.json... and manually giving my dir read and write access... and NOTHING! lol anyone else have any idea why this is happening?

UPDATE: I was able to solve this by rolling back nodejs version. I was running 9.10.1 so I rolled back to a much earlier version 6.10.1 and things started to work.

@bazzilio
Copy link

bazzilio commented Sep 19, 2018

Also hit the issue.
I can't hit the permission issue, because build node from the root.
:

root@bay7:~/git/mathserver# npm install 

> [email protected] install /home/admbay/git/mathserver/node_modules/libpq
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/admbay/git/mathserver/node_modules/libpq/build'
gyp ERR! System Linux 4.4.0-134-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/admbay/git/mathserver/node_modules/libpq
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

debug logs

96 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle false
97 verbose lifecycle [email protected]~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/admbay/git/mathserver/node_modules/libpq/node_modules/.bin:/home/admbay/git/mathserver/node_modules/.bin:/home/admbay/
bin:/home/admbay/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/snap/bin
98 verbose lifecycle [email protected]~install: CWD: /home/admbay/git/mathserver/node_modules/libpq
99 silly lifecycle [email protected]~install: Args: [ '-c', 'node-gyp rebuild' ]
100 silly lifecycle [email protected]~install: Returned: code: 1  signal: null
101 info lifecycle [email protected]~install: Failed to exec install script
102 timing action:install Completed in 431ms

My Solution:
apt install build-essential postgresql-common

@Xetera
Copy link

Xetera commented May 30, 2020

Installing some missing packages

sudo apt install build-essential postgresql-common postgresql-server-dev-10

seems to have fixed the issue for me

@nazmuddin
Copy link

nazmuddin commented Jan 14, 2021

Did you find any solution for this? I am using node version 12, postgres 12. And getting the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants