netlify / cli

Netlify Command Line Interface
http://cli.netlify.com
MIT License
1.56k stars 343 forks source link

bug: import `execa` not found `bun install` failed for `postinstall` script #6708

Closed laciferin2024 closed 3 weeks ago

laciferin2024 commented 3 weeks ago

Describe the bug

  🚚 @netlify/build... file:///Volumes/N/Reclaim/zauth/node_modules/@netlify/config/lib/env/git.js:1
import { execa } from 'execa';
         ^^^^^
SyntaxError: Named export 'execa' not found. The requested module 'execa' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'execa';
const { execa } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Steps to reproduce

    "netlify-cli": "^17.23.1",

bun.lockb.zip

bun install with the bun.lockb attached

Configuration

No response

Environment

System: OS: macOS 14.5 CPU: (8) arm64 Apple M1 Memory: 100.30 MB / 8.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.0 - /usr/local/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 9.8.1 - /opt/homebrew/bin/npm pnpm: 9.1.0 - /opt/homebrew/bin/pnpm bun: 1.1.7 - /opt/homebrew/bin/bun npmPackages: netlify-cli: ^17.23.1 => 17.27.0 npmGlobalPackages: netlify-cli: 17.23.1

laciferin2024 commented 3 weeks ago

Note to set:

  "trustedDependencies": [
    "netlify-cli",
]
Jarred-Sumner commented 3 weeks ago

This is a bug in Bun - please upgrade to Bun v1.1.13

laciferin2024 commented 3 weeks ago

thanks @Jarred-Sumner it worked