libp2p / js-libp2p-amino-dht-bootstrapper

A CLI for starting an Amino DHT bootstrapper
Other
1 stars 2 forks source link

bug: docker build is failing locally and in CI #132

Closed SgtPooki closed 2 months ago

SgtPooki commented 2 months ago
 => ERROR [5/5] RUN npm run build                                                                                                                                                           0.6s
------
 > [5/5] RUN npm run build:
0.276
0.276 > @libp2p/amino-dht-bootstrapper@1.1.13 build
0.276 > aegir build --bundle false
0.276
0.583 file:///node_modules/aegir/src/utils.js:33
0.583   packageJson: pkg,
0.583                ^
0.583
0.583 TypeError: Cannot destructure property 'packageJson' of 'readPackageUpSync(...)' as it is undefined.
0.583     at file:///node_modules/aegir/src/utils.js:33:16
0.583     at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
0.583     at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
0.583     at async loadESM (node:internal/process/esm_loader:34:7)
0.583     at async handleMainPromise (node:internal/modules/run_main:106:12)
0.583
0.583 Node.js v18.20.2
------
Dockerfile:6
--------------------
   4 |     RUN npm ci --quiet
   5 |     COPY . .
   6 | >>> RUN npm run build
   7 |     ENTRYPOINT [ "node", "dist/src/index.js" ]
   8 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

https://github.com/libp2p/js-libp2p-amino-dht-bootstrapper/actions/runs/8989734979/job/24693739303

SgtPooki commented 2 months ago

some debugging:

╰─ ✘ INT ❯ DOCKER_BUILDKIT=0 docker compose -f docker-compose.dev.yaml up
Sending build context to Docker daemon  63.79MB
Step 1/8 : FROM node:18-alpine
18-alpine: Pulling from library/node
bca4290a9639: Already exists
ed2e2467392d: Already exists
8409080807cd: Already exists
8fabd45d2d86: Already exists
Digest: sha256:4837c2ac8998cf172f5892fb45f229c328e4824c43c8506f8ba9c7996d702430
Status: Downloaded newer image for node:18-alpine
 ---> 271392516baf
Step 2/8 : COPY package*.json .
When using COPY with more than one source file, the destination must be a directory and end with a /
SgtPooki commented 2 months ago

more output:

added 1624 packages, and audited 2080 packages in 15s

365 packages are looking for funding
  run `npm fund` for details

5 moderate severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 10.5.0 -> 10.7.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.7.0>
npm notice Run `npm install -g npm@10.7.0` to update!
npm notice
 ---> Removed intermediate container 91c8c8cb60f5
 ---> 8ff56fa135e0
Step 4/6 : COPY . ./
 ---> 72792659cb3c
Step 5/6 : RUN npm run build
 ---> Running in 2c2498364251

> @libp2p/amino-dht-bootstrapper@1.1.13 build
> aegir build --bundle false

process.cwd() /
fs.realpathSync(process.cwd()) /
file:///node_modules/aegir/src/utils.js:35
  packageJson: pkg,
               ^

TypeError: Cannot destructure property 'packageJson' of 'readPackageUpSync(...)' as it is undefined.
    at file:///node_modules/aegir/src/utils.js:35:16
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12)

Node.js v18.20.2
The command '/bin/sh -c npm run build' returned a non-zero code: 1