thomas4019 / pgmongo

Replace MongoDB with PostgreSQL using jsonb fields
132 stars 7 forks source link

build error on ubuntu 18 #2

Closed motherfogger closed 5 years ago

motherfogger commented 5 years ago

is this error in build? something to do with gyp?

sudo npm install -g pgmongo
[sudo] password for codee: 
/usr/bin/pgmongo -> /usr/lib/node_modules/pgmongo/index.js
+ pgmongo@0.1.0
updated 1 package in 2.646s
codee@codee-pc:~$ pgmongo
/usr/lib/node_modules/pgmongo/node_modules/bindings/bindings.js:99
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /usr/lib/node_modules/pgmongo/node_modules/bson-ext/build/bson.node
 → /usr/lib/node_modules/pgmongo/node_modules/bson-ext/build/Debug/bson.node
 → /usr/lib/node_modules/pgmongo/node_modules/bson-ext/build/Release/bson.node
 → /usr/lib/node_modules/pgmongo/node_modules/bson-ext/out/Debug/bson.node
 → /usr/lib/node_modules/pgmongo/node_modules/bson-ext/Debug/bson.node
 → /usr/lib/node_modules/pgmongo/node_modules/bson-ext/out/Release/bson.node
 → /usr/lib/node_modules/pgmongo/node_modules/bson-ext/Release/bson.node
 → /usr/lib/node_modules/pgmongo/node_modules/bson-ext/build/default/bson.node
 → /usr/lib/node_modules/pgmongo/node_modules/bson-ext/compiled/8.12.0/linux/x64/bson.node
    at bindings (/usr/lib/node_modules/pgmongo/node_modules/bindings/bindings.js:96:9)
    at Object.<anonymous> (/usr/lib/node_modules/pgmongo/node_modules/bson-ext/lib/index.js:1:93)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/pgmongo/index.js:3:14)

machine

codee@codee-pc:~$ node --version
v8.12.0

codee@codee-pc:~$ npm --version
6.4.1

codee@codee-pc:~$ psql --version
psql (PostgreSQL) 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1)

ive tried uninstalling it

codee@codee-pc:~$ sudo npm uninstall -g pgmongo
removed 26 packages in 0.271s
codee@codee-pc:~$ sudo npm install -g pgmongo
/usr/bin/pgmongo -> /usr/lib/node_modules/pgmongo/index.js

> bson-ext@2.0.1 install /usr/lib/node_modules/pgmongo/node_modules/bson-ext
> (node-gyp rebuild 2> builderror.log) || (exit 0)

sh: 1: cannot create builderror.log: Permission denied
+ pgmongo@0.1.0
added 26 packages from 25 contributors in 0.722s
codee@codee-pc:~$ npm install -g pgmongo
npm WARN checkPermissions Missing write access to /usr/lib/node_modules/pgmongo
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules/pgmongo
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules/pgmongo'
npm ERR!  { Error: EACCES: permission denied, access '/usr/lib/node_modules/pgmongo'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/lib/node_modules/pgmongo\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules/pgmongo' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/codee/.npm/_logs/2019-01-09T01_56_29_726Z-debug.log
thomas4019 commented 5 years ago

Hi, I'm wondering if this is due to a problem with global install so can you try running the following in some temp folder?

npm install pgmongo
./node_modules/pgmongo/index.js localhost