Skip to content

bug: Cannot find module @rollup/rollup-darwin-arm64 #6195

@hettiger

Description

@hettiger

Prerequisites

Stencil Version

4.28.0

Current Behavior

Cannot build on Apple Silicon:

yarn create stencil
# choose components
# name: stencil-rollup
cd stencil-rollup
npm install
npm start

> stencil-rollup@0.0.1 start
> stencil build --dev --watch --serve

[17:44.3]  @stencil/core

[ ERROR ]  uncaught cli error: Error: Cannot find module @rollup/rollup-darwin-arm64. npm has a bug related to optional
           dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both
           package-lock.json and node_modules directory.

Expected Behavior

optionalDependencies in package.json should probably include more architectures. I have fixed this in my projects package.json using:

  "optionalDependencies": {
    "@rollup/rollup-linux-x64-gnu": "4.34.9",
    "@rollup/rollup-linux-x64-musl": "4.34.9",
    "@rollup/rollup-linux-arm64-gnu": "4.34.9",
    "@rollup/rollup-linux-arm64-musl": "4.34.9",
    "@rollup/rollup-darwin-arm64": "4.34.9",
    "@rollup/rollup-darwin-x64": "4.34.9",
    "@rollup/rollup-win32-x64-msvc": "4.34.9",
    "@rollup/rollup-win32-arm64-msvc": "4.34.9"
  },

However, this should be coming from @stencil/core or from ideally from @rollup? I'm also not sure if the list should be appended with more architectures etc.?

System Info

npx stencil info

      System: node 22.13.1
    Platform: darwin (24.3.0)
   CPU Model: Apple M4 Max (16 cpus)
    Compiler: /Users/hettiger/Documents/Projekte/2022/2022-09__MEUIKit/meuikit/components/node_modules/@stencil/core/compiler/stencil.js
       Build: 1741737629
     Stencil: 4.28.0 🎩
  TypeScript: 5.5.4
      Rollup: 4.34.9
      Parse5: 7.2.1
      jQuery: 4.0.0-pre
      Terser: 5.37.0

Steps to Reproduce

See: Current Behavior

Code Reproduction URL

See: Current Behavior

Additional Information

This was introduced with d54c44c

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within Stencil

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions