better-sqlite3 icon indicating copy to clipboard operation
better-sqlite3 copied to clipboard

can't install on github actions

Open RichardWright opened this issue 4 years ago • 4 comments

Node- node:14.18 OS -alpine3.14 better-sqlite3 - 7.4.4

Any ideas? `

Step 1/12 : FROM node:14.18-alpine3.14 ---> 50cbc6aabbbd Step 2/12 : RUN apk add --no-cache --virtual .build-deps alpine-sdk=1.0-r1 python3=3.9.5-r1 dumb-init=1.2.5-r1 libcrypto1.1=1.1.1l-r0 libssl1.1=1.1.1l-r0 ---> Using cache ---> f1185c07f68f Step 3/12 : ENV NODE_ENV production ---> Using cache ---> b114848f5409 Step 4/12 : WORKDIR /usr/src/app ---> Using cache ---> 93cf35cde3f9 Step 5/12 : COPY package.json ./ ---> 3e302398b947 Step 6/12 : COPY yarn.lock ./ ---> b87377fcc1cb Step 7/12 : RUN yarn install --frozen-lockfile --production && yarn cache clean ---> Running in daf6938ded64 yarn install v1.22.15 [1/4] Resolving packages... [2/4] Fetching packages... info [email protected]: The platform "linux" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... error /usr/src/app/node_modules/better-sqlite3: Command failed. Exit code: 1 Command: prebuild-install || npm run build-release Arguments: Directory: /usr/src/app/node_modules/better-sqlite3 Output: prebuild-install WARN install No prebuilt binaries found (target=14.18.1 runtime=node arch=x64 libc=musl platform=linux) npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1635801141190-0.20112437336219835/node but npm is using /usr/local/bin/node itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with.

[email protected] build-release /usr/src/app/node_modules/better-sqlite3 node-gyp rebuild --release

make: Entering directory '/usr/src/app/node_modules/better-sqlite3/build' make: printf: Operation not permitted make: *** [deps/locate_sqlite3.target.mk:16: b857c92884e9598d609f6be182a2595df7a8e00f.intermediate] Error 127 make: Leaving directory '/usr/src/app/node_modules/better-sqlite3/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:400:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12) gyp ERR! System Linux 5.4.149-73.259.amzn2.x86_64 gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" gyp ERR! cwd /usr/src/app/node_modules/better-sqlite3 gyp ERR! node -v v14.18.1 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] build-release: node-gyp rebuild --release npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build-release 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/2021-11-01T21_12_24_252Z-debug.log info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. The command '/bin/sh -c yarn install --frozen-lockfile --production && yarn cache clean' returned a non-zero code: 1 Error: Process completed with exit code 1. `

RichardWright avatar Nov 01 '21 21:11 RichardWright

I had to install a bunch of build tools to make Alpine containers compile:

RUN apk update ; apk upgrade ; apk add --no-cache \
  autoconf \
  build-base \
  coreutils \
  libtool \
  pkgconf \
  python3-dev

(this may be able to be pared down more: it's from https://github.com/photostructure/photostructure-for-servers/blob/main/Dockerfile)

mceachen avatar Nov 06 '21 18:11 mceachen

I'm getting the same error on circleci, in a node:14-alpine container, but the exact same build works in the exact same container on my home machine. Installing the tools using the commands above didn't help. Strangely I can yarn add better-sqlite3 within the container, but I can't install it as a dependency in this one project (even though it's also using the latest version of better-sqlite3 which yarn add better-sqlite3 should be using also).

insidewhy avatar Nov 16 '21 06:11 insidewhy

@RichardWright It might help: https://discuss.circleci.com/t/unable-to-use-make/40552/4

hypertracking avatar Nov 16 '21 08:11 hypertracking

the github runner we use doesn't support docker 20 yet. We've had to migrate away from this library because of it.

RichardWright avatar Nov 16 '21 09:11 RichardWright

This issue is pretty ancient--node 14 isn't supported anymore, and my comment addresses Alpine.

mceachen avatar Aug 24 '23 17:08 mceachen