When I run npm install pouchdb I get this error.
prebuild-install WARN install No prebuilt binaries found (target=10.3.0 runtime=node arch=x64 platform=linux)
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/var/www/html/project-folder/node_modules/leveldown/build'
gyp ERR! System Linux 4.14.13-200.fc26.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/www/html/project-folder/node_modules/leveldown
gyp ERR! node -v v10.3.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-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:
npm ERR! /root/.npm/_logs/2018-10-29T19_20_05_662Z-debug.log
same
This seems to be related to your server file system and not pouchdb
Leveldown is a native (writtn in C) dependency that requires a more involved build process
From the system paths in your error message, it looks like you're trying to build leveldown inside the active folders on your web server. For security reasons these permissions are usually restricted by default and i would not recommend changing these permissions
Here are 3 paths you can take:
1) Download your code in a different directory, like under your home folder (~/project-folder) and run npm install there. Then copy the code into the webserver (cp ~/project-folder /var/www/project-folder)
2) if you're using PouchDB on the frontend, you can replace the pouchdb package with pouchdb-browser, then you will not install leveldown and you won't have the problem
3) If you're using PouchDB on the backend, but you don't need to save to disk, you can create your own PouchDB custom build and skip leveldown.
I'm going to close the issue but you can still post follow ups here :)
Cheers!
I solved it installaing Windows build tools + Python 2.7.15 (in Windows 10 it's already installed) + maybe node-gyp? Dont know if that make any difference.
Loving pouch so far.
I'm glad you found a solution and thank you for posting it here!
It will be helpful for other people running into the same issue.
Python versions can make or break node-gyp builds for sure
Happy pouching!