pouchdb-server icon indicating copy to clipboard operation
pouchdb-server copied to clipboard

Warn/Error during install of leveldown dependency

Open kkitay opened this issue 7 years ago • 3 comments

I'm not able to Dockerize a pouchdb server because of a warning when attempting to install leveldown. I am currently using Node verion 8.12. I see lots of related problems to this but seemingly no solutions after quite some searching. Can anyone help figure out what's going on?

> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=8.12.0 runtime=node arch=x64 platform=linux)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.9.93-linuxkit-aufs
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 /usr/src/client/node_modules/leveldown
gyp ERR! node -v v8.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

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-23T17_30_04_311Z-debug.log```

kkitay avatar Oct 23 '18 17:10 kkitay

For me, python2.7 needs to be installed

If python3 is the default, for me npm needs the argument

--python=`which python2.7`

AFAICT, all of this stems from gyp as a dependency

fdenzer avatar Oct 30 '18 14:10 fdenzer

please help an African , I'm also getting the same error

paulgrammer avatar Jan 08 '19 00:01 paulgrammer

I emailed you back Paul but for posterity I did find a solution.

@fdenzer is correct: in the Docker container, you need to install Python 2.7 to install node-gyp. I found a Docker command that lets you install python and then run npm install. It's in my Dockerfile here: https://github.com/kkitay/streaming-into-the-void/blob/master/server/Dockerfile

The key part is this:

RUN apk --no-cache --virtual build-dependencies add \
    python \
    make \
    g++ \
    && npm install \
    && apk del build-dependencies

kkitay avatar Jan 08 '19 00:01 kkitay