oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
72.11k stars 2.58k forks source link

installing npm packages inside a docker container fails #1590

Open yvz5 opened 1 year ago

yvz5 commented 1 year ago

What version of Bun is running?

0.3.0

What platform is your computer?

Linux 5.15.49-linuxkit #1 SMP Tue Sep 13 07:51:46 UTC 2022 x86_64 unknown

What steps can reproduce the bug?

create a dockerfile and try to install npm pacakges inside the dockerfile:

RUN curl -fsSL https://bun.sh/install | bash
COPY package.json /build
RUN ~/.bun/bin/bun install >&2

and build it like so :

docker build  -t bun-version . --progress=plain

How often does it reproduce? Is there a required condition?

everytime

What is the expected behavior?

bun installs packages

What do you see instead?

#13 [builder  6/14] RUN ~/.bun/bin/bun install >&2
#13 sha256:96d654a256877be1dcda43e88378c69091ebfd9be2a89f285b332cdffc9bb30c
#13 0.249 bun install v0.3.0 (a13e64c2)
#13 0.251  Resolving dependencies
#13 88.51 Integrity check failed for tarball: method-override
#13 88.51 error: IntegrityCheckFailed extracting tarball for method-override
#13 88.51 Integrity check failed for tarball: prom-client
#13 88.51 error: IntegrityCheckFailed extracting tarball for prom-client
#13 94.42 Integrity check failed for tarball: debug
#13 94.42 error: IntegrityCheckFailed extracting tarball for debug
#13 94.43 Integrity check failed for tarball: kafkajs
#13 94.43 Integrity check failed for tarball: express
#13 94.43 Integrity check failed for tarball: path-to-regexp
#13 94.43 Integrity check failed for tarball: humanize-ms
#13 94.43 error: IntegrityCheckFailed extracting tarball for kafkajs
#13 94.43 error: IntegrityCheckFailed extracting tarball for express
#13 94.43 error: IntegrityCheckFailed extracting tarball for path-to-regexp
#13 94.43 error: IntegrityCheckFailed extracting tarball for humanize-ms
#13 94.43 Integrity check failed for tarball: node-mocks-http
#13 94.43 error: IntegrityCheckFailed extracting tarball for node-mocks-http
#13 94.43 Integrity check failed for tarball: @tusbar/cache-control
#13 94.43 error: IntegrityCheckFailed extracting tarball for @tusbar/cache-control
#13 94.43 Integrity check failed for tarball: debug
#13 94.43 error: IntegrityCheckFailed extracting tarball for debug
#13 94.43 Integrity check failed for tarball: universalify
#13 94.43 Integrity check failed for tarball: polyfill-library
#13 94.43 Integrity check failed for tarball: punycode
#13 94.43 error: IntegrityCheckFailed extracting tarball for universalify
#13 94.43 error: IntegrityCheckFailed extracting tarball for polyfill-library
#13 94.43 error: IntegrityCheckFailed extracting tarball for punycode
#13 94.43 Integrity check failed for tarball: anymatch
#13 94.43 error: IntegrityCheckFailed extracting tarball for anymatch
#13 94.43 Integrity check failed for tarball: is-binary-path
#13 94.43 error: IntegrityCheckFailed extracting tarball for is-binary-path
#13 94.43 Integrity check failed for tarball: normalize-path
#13 94.43 error: IntegrityCheckFailed extracting tarball for normalize-path
#13 94.46 Integrity check failed for tarball: avsc
#13 94.46 error: IntegrityCheckFailed extracting tarball for avsc
#13 94.46 Integrity check failed for tarball: url-parse
#13 94.46 error: IntegrityCheckFailed extracting tarball for url-parse
#13 94.46 Integrity check failed for tarball: is-glob
#13 94.46 Integrity check failed for tarball: depd
#13 94.46 error: IntegrityCheckFailed extracting tarball for is-glob
#13 94.46 error: IntegrityCheckFailed extracting tarball for depd
#13 94.46 Integrity check failed for tarball: depd
#13 94.46 error: IntegrityCheckFailed extracting tarball for depd
#13 94.46 Integrity check failed for tarball: follow-redirects
#13 94.46 error: IntegrityCheckFailed extracting tarball for follow-redirects
#13 94.46 Integrity check failed for tarball: glob-parent
#13 94.46 error: IntegrityCheckFailed extracting tarball for glob-parent
#13 94.46 Integrity check failed for tarball: readdirp
#13 94.46 Integrity check failed for tarball: psl
#13 94.46 error: IntegrityCheckFailed extracting tarball for readdirp
#13 94.46 error: IntegrityCheckFailed extracting tarball for psl
#13 94.46 Integrity check failed for tarball: braces
#13 94.46 error: IntegrityCheckFailed extracting tarball for braces
#13 94.46 Integrity check failed for tarball: ioredis
#13 94.46 error: IntegrityCheckFailed extracting tarball for ioredis
#13 94.47 Integrity check failed for tarball: debug
#13 94.47 error: IntegrityCheckFailed extracting tarball for debug
#13 94.47 Integrity check failed for tarball: opossum
#13 94.47 Integrity check failed for tarball: express-promise-router
#13 94.47 error: IntegrityCheckFailed extracting tarball for opossum
#13 94.47 error: IntegrityCheckFailed extracting tarball for express-promise-router
#13 94.47 Integrity check failed for tarball: node-jose
#13 94.47 error: IntegrityCheckFailed extracting tarball for node-jose
#13 94.47 Integrity check failed for tarball: path-to-regexp
#13 94.47 Integrity check failed for tarball: express-hawk
#13 94.47 error: IntegrityCheckFailed extracting tarball for path-to-regexp
#13 94.47 error: IntegrityCheckFailed extracting tarball for express-hawk
#13 94.48 Integrity check failed for tarball: jsonwebtoken
#13 94.48 error: IntegrityCheckFailed extracting tarball for jsonwebtoken
#13 94.48 Integrity check failed for tarball: murmurhash
#13 94.48 error: IntegrityCheckFailed extracting tarball for murmurhash
#13 94.48 Integrity check failed for tarball: html-entities
#13 94.48 error: IntegrityCheckFailed extracting tarball for html-entities
#13 94.48 Integrity check failed for tarball: toobusy-js
#13 94.48 error: IntegrityCheckFailed extracting tarball for toobusy-js
#13 94.48 Integrity check failed for tarball: body-parser
#13 94.48 Integrity check failed for tarball: chokidar
#13 94.48 Integrity check failed for tarball: ejs
#13 94.48 error: IntegrityCheckFailed extracting tarball for body-parser
#13 94.48 error: IntegrityCheckFailed extracting tarball for chokidar
#13 94.48 error: IntegrityCheckFailed extracting tarball for ejs
#13 94.48 Integrity check failed for tarball: strict-event-emitter-types
#13 94.48 error: IntegrityCheckFailed extracting tarball for strict-event-emitter-types
#13 96.49  Resolved, downloaded and extracted [918]
#13 96.49 error: @tsconfig/node16@^1.0.3 failed to resolve
#13 96.49 error: @types/body-parser@^1.19.2 failed to resolve
#13 96.49 error: @types/compression@^1.7.2 failed to resolve
#13 96.49 error: @types/cookie-parser@^1.4.3 failed to resolve
#13 96.49 error: @types/jsonwebtoken@^8.5.9 failed to resolve
#13 96.49 error: @types/method-override@^0.0.32 failed to resolve
#13 96.49 error: @types/mocha@^10.0.1 failed to resolve
#13 96.49 error: @types/node@^16.11.54 failed to resolve
#13 96.49 error: @types/opossum@^6.2.2 failed to resolve
#13 96.49 error: @types/polyfill-library@^3.108.1 failed to resolve
#13 96.49 error: @types/sinon@^10.0.13 failed to resolve
#13 96.49 error: @types/toobusy-js@^0.5.2 failed to resolve
#13 96.49 error: @types/tough-cookie@^4.0.2 failed to resolve
#13 96.49 error: @typescript-eslint/eslint-plugin@^5.45.1 failed to resolve
#13 96.49 error: @typescript-eslint/parser@^5.45.1 failed to resolve
#13 96.49 error: compression@^1.7.4 failed to resolve
#13 96.49 error: eslint@^8.29.0 failed to resolve
#13 96.49 error: eslint-import-resolver-typescript@^3.5.2 failed to resolve
#13 96.49 error: eslint-plugin-import@^2.26.0 failed to resolve
#13 96.49 error: jsdom@^20.0.3 failed to resolve
#13 96.49 error: mocha@^10.1.0 failed to resolve
#13 96.49 error: @financial-times/polyfill-useragent-normaliser@^2.0.1 failed to resolve
#13 96.49 error: from2-string@^1.1.0 failed to resolve
#13 96.49 error: graceful-fs@^4.2.10 failed to resolve
#13 96.49 error: merge2@^1.0.3 failed to resolve
#13 96.49 error: mnemonist@^0.39.2 failed to resolve
#13 96.49 error: stream-from-promise@^1.0.0 failed to resolve
#13 96.49 error: buffer@^6.0.3 failed to resolve
#13 96.49 error: process@^0.11.10 failed to resolve
#13 96.49 error: base64url@^3.0.1 failed to resolve
#13 96.49 error: buffer@^6.0.3 failed to resolve
#13 96.49 error: es6-promise@^4.2.8 failed to resolve
#13 96.49 error: lodash@^4.17.21 failed to resolve
#13 96.49 error: long@^5.2.0 failed to resolve
#13 96.49 error: node-forge@^1.2.1 failed to resolve
#13 96.49 error: pako@^2.0.4 failed to resolve
#13 96.49 error: process@^0.11.10 failed to resolve
#13 96.49 error: methods@~1.1.2 failed to resolve
#13 96.49 error: parseurl@~1.3.2 failed to resolve
#13 96.49 error: vary@~1.1.2 failed to resolve
#13 96.49 error: ms@2.0.0 failed to resolve
#13 96.49 error: lodash.isboolean@^3.0.3 failed to resolve
#13 96.49 error: lodash.isinteger@^4.0.4 failed to resolve
#13 96.49 error: lodash.isstring@^4.0.1 failed to resolve
#13 96.49 error: lodash.once@^4.0.0 failed to resolve
#13 96.49 error: ms@^2.1.1 failed to resolve
#13 96.49 error: semver@^5.6.0 failed to resolve
#13 96.49 error: @ioredis/commands@^1.1.1 failed to resolve
#13 96.49 error: cluster-key-slot@^1.1.0 failed to resolve
#13 96.49 error: denque@^2.0.1 failed to resolve
#13 96.49 error: redis-errors@^1.2.0 failed to resolve
#13 96.49 error: redis-parser@^3.0.0 failed to resolve
#13 96.49 error: standard-as-callback@^2.1.0 failed to resolve
#13 96.49 error: ms@2.1.2 failed to resolve
#13 96.49 error: is-promise@^4.0.0 failed to resolve
#13 96.49 error: lodash.flattendeep@^4.0.0 failed to resolve
#13 96.49 error: accepts@~1.3.8 failed to resolve
#13 96.49 error: encodeurl@~1.0.2 failed to resolve
#13 96.49 error: escape-html@~1.0.3 failed to resolve
#13 96.49 error: etag@~1.8.1 failed to resolve
#13 96.49 error: finalhandler@1.2.0 failed to resolve
#13 96.49 error: fresh@0.5.2 failed to resolve
#13 96.49 error: http-errors@2.0.0 failed to resolve
#13 96.49 error: merge-descriptors@1.0.1 failed to resolve
#13 96.49 error: methods@~1.1.2 failed to resolve
#13 96.49 error: on-finished@2.4.1 failed to resolve
#13 96.49 error: parseurl@~1.3.3 failed to resolve
#13 96.49 error: proxy-addr@~2.0.7 failed to resolve
#13 96.49 error: qs@6.11.0 failed to resolve
#13 96.49 error: range-parser@~1.2.1 failed to resolve
#13 96.49 error: picomatch@^2.0.4 failed to resolve
#13 96.49 error: methods@^1.1.2 failed to resolve
#13 96.49 error: mime@^1.3.4 failed to resolve
#13 ERROR: executor failed running [/bin/sh -c ~/.bun/bin/bun install >&2]: exit code: 1
------
 > [builder  6/14] RUN ~/.bun/bin/bun install >&2:
------
executor failed running [/bin/sh -c ~/.bun/bin/bun install >&2]: exit code: 1

Additional information

maybe the base docker image plays a role here ? are there any requirements for bun to work ?

Electroid commented 1 year ago

@yvz5 What base image are you running? If possible, could you provide the full Dockerfile?

yvz5 commented 1 year ago
FROM node:16.16.0
WORKDIR /build

RUN curl -fsSL https://bun.sh/install | bash
COPY package.json /build
RUN ~/.bun/bin/bun install >&2

package.json

{
    "name": "a",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
    },
    "keywords": [],
    "author": "",
    "license": "ISC",
    "dependencies": {
        "@instana/collector": "^2.13.0",
        "@tusbar/cache-control": "^0.6.1",
        "@wireapp/lru-cache": "^3.8.1",
        "agentkeepalive": "^4.2.1",
        "ajv": "^8.11.2",
        "avsc": "^5.7.7",
        "axios": "^0.27.2",
        "body-parser": "^1.20.1",
        "chokidar": "^3.5.3",
        "cookie-parser": "^1.4.6",
        "dns-cache": "^2.0.0",
        "ejs": "^3.1.8",
        "express": "^4.18.2",
        "express-hawk": "^1.1.1",
        "express-promise-router": "^4.1.1",
        "html-entities": "^2.3.3",
        "ioredis": "^5.2.4",
        "jsonwebtoken": "^8.5.1",
        "kafkajs": "^2.2.3",
        "method-override": "^3.0.0",
        "murmurhash": "^2.0.1",
        "node-jose": "^2.1.1",
        "opossum": "^7.0.1",
        "path-to-regexp": "^3.1.0",
        "pino": "^8.7.0",
        "polyfill-library": "^4.5.0",
        "prom-client": "^14.1.0",
        "toobusy-js": "^0.5.1"
    }
}

I think it has something todo with this combination of packages. If I only add express as a dependency, it works. If I then keep adding more packages from the above list, it starts throwing these error messages about the integrity. I tried to nail it down to a single package but it seems like it is random each time. after a while started even complaining about express. Note that above combination of dependencies work locally with bun cli. Error happens only in a docker container.

yharaskrik commented 1 year ago

I am seeing the same thing just on CI on CircleCI

    resource_class: arm.medium
    machine:
        image: ubuntu-2004:202201-02

Not a docker container as I am using a machine executor running ubuntu.

dalisoft commented 1 year ago

Same issue for me

example log:

[1.42ms] ".env"\n' +
    'bun install v0.5.2 (f9fd7e9d)\n' +
    ' Resolving dependencies\n' +
    'Integrity check failed for tarball: @aws-sdk/querystring-parser\n' +
    'error: IntegrityCheckFailed extracting tarball for @aws-sdk/querystring-parser\n' +
    'Error ShortRead decompressing uWebSockets.js\n'
Electroid commented 1 year ago

We recently launched a new Docker image at oven/bun. Could you try that and see if that fixes this issue for you?

johnbchron commented 1 year ago

Does not fix for me

Dockerfile:

FROM oven/bun

WORKDIR /app
COPY package.json ./
RUN bun install

COPY . .
EXPOSE 3000

CMD [ "bun", "run", "build:start" ]

package.json:

{
  "name": "listr_frontend",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "build:start": "next build && next start"
  },
  "dependencies": {
    "@fortawesome/fontawesome-free": "^6.3.0",
    "daisyui": "^2.50.0",
    "file-saver": "^2.0.5",
    "ioredis": "^5.3.0",
    "next": "13.1.6",
    "postcss-cli": "^10.1.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "swr": "^2.0.3",
    "uuid": "^9.0.0"
  },
  "devDependencies": {
    "autoprefixer": "^10.4.13",
    "postcss": "^8.4.21",
    "sass": "^1.58.0",
    "cssnano": "^4.1.10",
    "tailwindcss": "^3.2.6"
  }
}

truncated output:

 => => # bun install v0.5.6 (ddec9e0b)                                                                                                                                                                                                    
 => => #  Resolving dependencies                                                                                                                                                                                                          
 => => # Integrity check failed for tarball: postcss-cli                                                                                                                                                                                  
 => => # error: IntegrityCheckFailed extracting tarball for postcss-cli
Jarred-Sumner commented 1 year ago

That the failure is in the integrity check step is suspicious. It sounds like a new error. cc @alexlamsl

Jarred-Sumner commented 1 year ago

As a temporary workaround, set the environment variable BUN_CONFIG_NO_VERIFY=1 and that will skip the integrity check. This is likely a real bug though and skipping the integrity check would mean the package then fails to extract or has nonsensical data inside

droslean commented 1 year ago

Same issue here. BUN_CONFIG_NO_VERIFY=1 doesn't affect anything.

Jarred-Sumner commented 1 year ago

Are people still seeing this on Bun v0.5.7? We are having trouble reproducing the issue.

Phineas commented 1 year ago

Are people still seeing this on Bun v0.5.7? We are having trouble reproducing the issue.

Still seeing it on that version: image

You can reproduce this by building a Bun repository on https://hop.io

I'm trying to deploy this repository specifically: https://github.com/SaltyAom/elysia-demo

Jarred-Sumner commented 1 year ago

What’s the Linux kernel version?

On Tue, Feb 28, 2023 at 4:45 PM Phineas @.***> wrote:

Are people still seeing this on Bun v0.5.7? We are having trouble reproducing the issue.

Still seeing it on that version: [image: image] https://user-images.githubusercontent.com/6209808/222015919-bcc830f4-4c29-4246-b7bf-042482c09d8b.png

You can reproduce this by building a Bun repository on https://hop.io

I'm trying to deploy this repository specifically: https://github.com/SaltyAom/elysia-demo

— Reply to this email directly, view it on GitHub https://github.com/oven-sh/bun/issues/1590#issuecomment-1449141873, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFNGS53MLAO3AYAMGYDUHDWZ2L25ANCNFSM6AAAAAASYCDXAA . You are receiving this because you commented.Message ID: @.***>

Phineas commented 1 year ago

What’s the Linux kernel version?

Linux cd0e5af18575 5.15.0-47-generic #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022 x86_64 GNU/Linux

yvz5 commented 1 year ago

can confirm it doesnt happen on windows 10

cnrad commented 1 year ago

+1, also having this issue on Ubuntu

ghost commented 1 year ago

Same here , i literally tryed this atleast 300-400 (seriously) times and i still getting this issue even with cache in manual install its does gets installed but in docker build breaking it i get pass because project rules , (there shouldn't be any errors)

Jarred-Sumner commented 1 year ago

I really wish I knew how to reproduce this failure. Attempting to run a Docker image doesn't reproduce it on an Ubuntu host running Linux kernel 5.17.

My best guess right now is either:

yvz5 commented 1 year ago

Try to use github actions. It is the same thing

Phineas commented 1 year ago

Providing some info about the environment on a container where I can reproduce the issue. We're also using DinD (docker in docker) using the sysbox runtime.

ulimit:

root@9f076edf88e6:~# ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 2062438
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1048576
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

mem:

root@9f076edf88e6:~# free -g
              total        used        free      shared  buff/cache   available
Mem:            503          82          20           0         400         417
Swap:             7           2           5

filesys:

root@9f076edf88e6:~# stat -f -c %T /
UNKNOWN (0x6a656a62)

root@9f076edf88e6:~# df
Filesystem                         1K-blocks      Used  Available Use% Mounted on
.                                 1949358100 647577052 1301781048  34% /
tmpfs                                   1024         0       1024   0% /sys/kernel/config
tmpfs                                   1024         0       1024   0% /sys/kernel/debug
tmpfs                                   1024         0       1024   0% /sys/kernel/tracing
tmpfs                                  65536         0      65536   0% /dev
shm                                    65536         0      65536   0% /dev/shm
udev                               263992092         0  263992092   0% /dev/tty
/dev/mapper/docker--vg-overlay    1949358100 647577052 1301781048  34% /etc/hosts
/dev/mapper/ubuntu--vg-ubuntu--lv  205839032  23389940  172974656  12% /var/lib/k0s
tmpfs                              264077504         0  264077504   0% /proc/asound
tmpfs                              264077504         0  264077504   0% /proc/acpi
tmpfs                              264077504         0  264077504   0% /proc/scsi
tmpfs                              264077504         0  264077504   0% /sys/firmware

cpu:

root@9f076edf88e6:~# lscpu
Architecture:         x86_64
CPU op-mode(s):       32-bit, 64-bit
Byte Order:           Little Endian
Address sizes:        48 bits physical, 48 bits virtual
CPU(s):               256
On-line CPU(s) list:  0-254
Off-line CPU(s) list: 255
Thread(s) per core:   1
Core(s) per socket:   64
Socket(s):            2
NUMA node(s):         16
Vendor ID:            AuthenticAMD
CPU family:           25
Model:                1
Model name:           AMD EPYC 7713 64-Core Processor
Stepping:             1
CPU MHz:              1449.351
CPU max MHz:          3720.7029
CPU min MHz:          1500.0000
BogoMIPS:             4000.12
Virtualization:       AMD-V
L1d cache:            32K
L1i cache:            32K
L2 cache:             512K
L3 cache:             32768K
NUMA node0 CPU(s):    0-7,128-135
NUMA node1 CPU(s):    8-15,136-143
NUMA node2 CPU(s):    16-23,144-151
NUMA node3 CPU(s):    24-31,152-159
NUMA node4 CPU(s):    32-39,160-167
NUMA node5 CPU(s):    40-47,168-175
NUMA node6 CPU(s):    48-55,176-183
NUMA node7 CPU(s):    56-63,184-191
NUMA node8 CPU(s):    64-71,192-199
NUMA node9 CPU(s):    72-79,200-207
NUMA node10 CPU(s):   80-87,208-215
NUMA node11 CPU(s):   88-95,216-223
NUMA node12 CPU(s):   96-103,224-231
NUMA node13 CPU(s):   104-111,232-239
NUMA node14 CPU(s):   112-119,240-247
NUMA node15 CPU(s):   120-127,248-254
Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca

docker inspect: https://gist.github.com/Phineas/270b8c1e98f33897d6ffb1a5254ac57b

ghost commented 1 year ago

Bug be can reproduced only in non interactive environment

Run bun installation by bash -c this will run the cmd in a non interactive sub shell

xlc commented 8 months ago

I am having this error with bun 1.0.7 with this Dockerfile

FROM oven/bun:alpine

COPY . .

RUN bun install --production --ignore-scripts

This happens for me in both interactive and non interactive environment.

bun install --ignore-scripts works

malthe commented 7 months ago

In my case, perhaps similar to @xlc, it happens only with --production.

(And it doesn't happen, unsurprisingly, when the install cache is already populated.)

Of course, like others have mentioned above, installing the production set only means that a different set of dependencies gets installed which could be the real issue.

Locally on my M1 Mac that works:

bun install v1.0.18 (36c316a2)
 + ts-typed-events@3.0.0

In a container running via Colima on the same system:

bun install v1.0.18 (36c316a2)
[20.69ms] migrated lockfile from package-lock.json
  🚚 typescript... error: IntegrityCheckFailed extracting tarball for typescript + ts-typed-events@3.0.0
[224.00ms] done

Not sure if the typescript + part has something to do with it?

If I first change to a temporary directory and do bun install ts-typed-events@3.0.0 (populating the install cache) and then switch back to repeat the package install, then everything works fine.