netlify / cli

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

Error occurring in CLI application #6371

Open molovo opened 5 months ago

molovo commented 5 months ago

Describe the bug

Error thrown in CLI for all commands, with message to report it here. Error below:

file:///Users/molovo/.files/files/.config/yarn/global/node_modules/@netlify/build/lib/plugins_core/functions/index.js:2
import { RUNTIME, zipFunctions } from '@netlify/zip-it-and-ship-it';
         ^^^^^^^
SyntaxError: Named export 'RUNTIME' not found. The requested module '@netlify/zip-it-and-ship-it' 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 '@netlify/zip-it-and-ship-it';
const { RUNTIME, zipFunctions } = 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)

  System:
    OS: macOS 13.5.2
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 20.11.0 - /usr/local/bin/node
    npm: 10.2.4 - /usr/local/bin/npm
  Browsers:
    Chrome: 121.0.6167.139
    Edge: 92.0.902.84
    Safari: 16.6

Steps to reproduce

Run any command in the CLI application

Configuration

Very minimal configuration:

[build]
  publish = "public"
  functions = "_functions"

Environment

  System:
    OS: macOS 13.5.2
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 430.76 MB / 16.00 GB
    Shell: 5.8 - /usr/local/bin/zsh
  Binaries:
    Node: 20.11.0 - /usr/local/bin/node
    npm: 10.2.4 - /usr/local/bin/npm
AleksandrHovhannisyan commented 3 months ago

I'm seeing this as well, immediately after installing 16.6.2 or higher. OP, were you able to resolve this by any chance?