Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default config is broken on OSX - cannot find module @rollup/rollup-darwin-arm64 #10909

Closed
gsovereignty opened this issue Mar 25, 2024 · 3 comments

Comments

@gsovereignty
Copy link

gsovereignty commented Mar 25, 2024

Describe the bug

When following the standard Svelte guide (npm create svelte@latest myapp...) I get an error when VS Code tries to load svelte.config.js: Cannot find module @rollup/rollup-darwin-arm64

I've tried using a fresh install of everything, it's nothing to do with my node directory etc.

Reproduction

  1. Follow the guide at https://svelte.dev/docs/introduction (and use Typescript).

  2. Open the project in VS Code.

Logs

Initialize language server at  file:///Users/gsovereignty/git/experiments/myapp
Initialize new ts service at  /Users/gsovereignty/git/experiments/myapp/tsconfig.json
Trying to load configs for /Users/gsovereignty/git/experiments/myapp
Error while loading config at  /Users/gsovereignty/git/experiments/myapp/svelte.config.js
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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}
Found svelte.config.js but there was an error loading it. Using https://github.com/sveltejs/svelte-preprocess as fallback
SnapshotManager File Statistics:
Project files: 22
Svelte files: 7
From node_modules: 0
Total: 22
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}

Node.js v18.17.1
[Info  - 13:44:28] Connection to server got closed. Server will restart.
true
Initialize language server at  file:///Users/gsovereignty/git/experiments/myapp
Initialize new ts service at  /Users/gsovereignty/git/experiments/myapp/tsconfig.json
Trying to load configs for /Users/gsovereignty/git/experiments/myapp
Error while loading config at  /Users/gsovereignty/git/experiments/myapp/svelte.config.js
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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}
Found svelte.config.js but there was an error loading it. Using https://github.com/sveltejs/svelte-preprocess as fallback
SnapshotManager File Statistics:
Project files: 22
Svelte files: 7
From node_modules: 0
Total: 22
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}

Node.js v18.17.1
[Info  - 13:44:29] Connection to server got closed. Server will restart.
true
Initialize language server at  file:///Users/gsovereignty/git/experiments/myapp
Initialize new ts service at  /Users/gsovereignty/git/experiments/myapp/tsconfig.json
Trying to load configs for /Users/gsovereignty/git/experiments/myapp
Error while loading config at  /Users/gsovereignty/git/experiments/myapp/svelte.config.js
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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}
Found svelte.config.js but there was an error loading it. Using https://github.com/sveltejs/svelte-preprocess as fallback
SnapshotManager File Statistics:
Project files: 22
Svelte files: 7
From node_modules: 0
Total: 22
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}

Node.js v18.17.1
[Info  - 13:44:29] Connection to server got closed. Server will restart.
true
Initialize language server at  file:///Users/gsovereignty/git/experiments/myapp
Initialize new ts service at  /Users/gsovereignty/git/experiments/myapp/tsconfig.json
Trying to load configs for /Users/gsovereignty/git/experiments/myapp
Error while loading config at  /Users/gsovereignty/git/experiments/myapp/svelte.config.js
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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}
Found svelte.config.js but there was an error loading it. Using https://github.com/sveltejs/svelte-preprocess as fallback
SnapshotManager File Statistics:
Project files: 22
Svelte files: 7
From node_modules: 0
Total: 22
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}

Node.js v18.17.1
[Info  - 13:44:30] Connection to server got closed. Server will restart.
true
Initialize language server at  file:///Users/gsovereignty/git/experiments/myapp
Initialize new ts service at  /Users/gsovereignty/git/experiments/myapp/tsconfig.json
Trying to load configs for /Users/gsovereignty/git/experiments/myapp
Error while loading config at  /Users/gsovereignty/git/experiments/myapp/svelte.config.js
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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}
Found svelte.config.js but there was an error loading it. Using https://github.com/sveltejs/svelte-preprocess as fallback
SnapshotManager File Statistics:
Project files: 22
Svelte files: 7
From node_modules: 0
Total: 22
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

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.
    at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:87:9)
    at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
    ... 2 lines matching cause stack trace ...
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js
      at Function._resolveFilename (node:internal/modules/cjs/loader:1084:15)
      at node:internal/modules/cjs/loader:929:27
      at Function._load (node:electron/js2c/node_init:2:13357)
      at Module.require (node:internal/modules/cjs/loader:1150:19)
      at require (node:internal/modules/cjs/helpers:121:18)
      at requireWithFriendlyError (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:69:10)
      at Object.<anonymous> (/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js:96:76)
      at Module._compile (node:internal/modules/cjs/loader:1271:14)
      at Object..js (node:internal/modules/cjs/loader:1326:10)
      at Module.load (node:internal/modules/cjs/loader:1126:32) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/Users/gsovereignty/git/experiments/myapp/node_modules/rollup/dist/native.js'
    ]
  }
}

Node.js v18.17.1
[Error - 13:44:30] The Svelte server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.


### System Info

```shell
System:
    OS: macOS 13.5
    CPU: (12) x64 Apple M2 Max
    Memory: 1.68 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.5.1 - /usr/local/bin/node
    Yarn: 1.22.18 - ~/.yarn/bin/yarn
    npm: 10.5.0 - /opt/homebrew/bin/npm
    pnpm: 7.21.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 123.0.6312.59
    Safari: 16.6
  npmPackages:
    svelte: ^4.2.7 => 4.2.12


### Severity

blocking all usage of svelte
@gsovereignty gsovereignty changed the title Default config is broken on OSX Default config is broken on OSX - cannot find module @rollup/rollup-darwin-arm64 Mar 25, 2024
@gsovereignty
Copy link
Author

gsovereignty commented Mar 25, 2024

same issue using pnpm (pnpm create svelte@latest myapp...)

/Users/gsovereignty/git/experiments/pmyapp/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:87
│ 		throw new Error(
│ 		      ^
│ Error: Cannot find module @rollup/rollup-darwin-x64. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both p…
│     at requireWithFriendlyError (/Users/gsovereignty/git/experiments/pmyapp/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:87:9)
│     at Object.<anonymous> (/Users/gsovereignty/git/experiments/pmyapp/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:96:76)
│     ... 3 lines matching cause stack trace ...
│     at Module._load (node:internal/modules/cjs/loader:938:12)
│     at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:165:29)
│     at ModuleJob.run (node:internal/modules/esm/module_job:192:25)
│     at async DefaultModuleLoader.import (node:internal/modules/esm/loader:228:24)
│     at async loadESM (node:internal/process/esm_loader:40:7) {
│   [cause]: Error: Cannot find module '@rollup/rollup-darwin-x64'
│   Require stack:
│   - /Users/gsovereignty/git/experiments/pmyapp/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js
│       at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
│       at Module._load (node:internal/modules/cjs/loader:901:27)
│       at Module.require (node:internal/modules/cjs/loader:1115:19)
│       at require (node:internal/modules/helpers:130:18)
│       at requireWithFriendlyError (/Users/gsovereignty/git/experiments/pmyapp/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:69:10)
│       at Object.<anonymous> (/Users/gsovereignty/git/experiments/pmyapp/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:96:76)
│       at Module._compile (node:internal/modules/cjs/loader:1233:14)
│       at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
│       at Module.load (node:internal/modules/cjs/loader:1091:32)
│       at Module._load (node:internal/modules/cjs/loader:938:12) {
│     code: 'MODULE_NOT_FOUND',
│     requireStack: [
│       '/Users/gsovereignty/git/experiments/pmyapp/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js'
│     ]
│   }
│ }
│ Node.js v20.5.1

@gsovereignty
Copy link
Author

In case anyone else runs into this problem, the solution is to install node and npm from https://nodejs.org/en/download rather than using brew.

@lacorde
Copy link

lacorde commented Jan 15, 2025

Same problem with node in a dockerized environment (no brew).
Can't consider this issue completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants