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

4.16.4 throws Cannot find module @rollup/rollup-darwin-arm64 error MODULE_NOT_FOUND in Ember Embroider app #5495

Closed
ChrisN-transnexus opened this issue Apr 26, 2024 · 4 comments

Comments

@ChrisN-transnexus
Copy link

Rollup Version

4.16.4

Operating System (or Browser)

MacOS Sonoma

Node Version (if applicable)

18.19.1

Link To Reproduction

https://rollupjs.org/repl/?version=4.16.4&shareable=JTdCJTIyZXhhbXBsZSUyMiUzQSUyMjAwJTIyJTJDJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMmNvZGUlMjIlM0ElMjIlMkYlMkYlMjBUUkVFLVNIQUtJTkclNUNuaW1wb3J0JTIwJTdCJTIwY3ViZSUyMCU3RCUyMGZyb20lMjAnLiUyRm1hdGhzLmpzJyUzQiU1Q24lNUNuY29uc29sZS5sb2coY3ViZSg1KSklM0IlMjAlMkYlMkYlMjAxMjUlMjIlMkMlMjJpc0VudHJ5JTIyJTNBdHJ1ZSUyQyUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTdEJTJDJTdCJTIyY29kZSUyMiUzQSUyMiUyRiUyRiUyMG1hdGhzLmpzJTVDbiU1Q24lMkYlMkYlMjBUaGlzJTIwZnVuY3Rpb24lMjBpc24ndCUyMHVzZWQlMjBhbnl3aGVyZSUyQyUyMHNvJTVDbiUyRiUyRiUyMFJvbGx1cCUyMGV4Y2x1ZGVzJTIwaXQlMjBmcm9tJTIwdGhlJTIwYnVuZGxlLi4uJTVDbmV4cG9ydCUyMGNvbnN0JTIwc3F1YXJlJTIwJTNEJTIweCUyMCUzRCUzRSUyMHglMjAqJTIweCUzQiU1Q24lNUNuJTJGJTJGJTIwVGhpcyUyMGZ1bmN0aW9uJTIwZ2V0cyUyMGluY2x1ZGVkJTVDbiUyRiUyRiUyMHJld3JpdGUlMjB0aGlzJTIwYXMlMjAlNjBzcXVhcmUoeCklMjAqJTIweCU2MCU1Q24lMkYlMkYlMjBhbmQlMjBzZWUlMjB3aGF0JTIwaGFwcGVucyElNUNuZXhwb3J0JTIwY29uc3QlMjBjdWJlJTIwJTNEJTIweCUyMCUzRCUzRSUyMHglMjAqJTIweCUyMColMjB4JTNCJTVDbiU1Q24lMkYlMkYlMjBUaGlzJTIwJTVDJTIyc2lkZSUyMGVmZmVjdCU1QyUyMiUyMGNyZWF0ZXMlMjBhJTIwZ2xvYmFsJTVDbiUyRiUyRiUyMHZhcmlhYmxlJTIwYW5kJTIwd2lsbCUyMG5vdCUyMGJlJTIwcmVtb3ZlZC4lNUNud2luZG93LmVmZmVjdDElMjAlM0QlMjAnY3JlYXRlZCclM0IlNUNuJTVDbmNvbnN0JTIwaW5jbHVkZUVmZmVjdCUyMCUzRCUyMGZhbHNlJTNCJTVDbmlmJTIwKGluY2x1ZGVFZmZlY3QpJTIwJTdCJTVDbiU1Q3QlMkYlMkYlMjBPbiUyMHRoZSUyMG90aGVyJTIwaGFuZCUyQyUyMHRoaXMlMjBpcyUyMG5ldmVyJTVDbiU1Q3QlMkYlMkYlMjBleGVjdXRlZCUyMGFuZCUyMHRodXMlMjByZW1vdmVkLiU1Q24lNUN0d2luZG93LmVmZmVjdDElMjAlM0QlMjAnbm90JTIwY3JlYXRlZCclM0IlNUNuJTdEJTIyJTJDJTIyaXNFbnRyeSUyMiUzQWZhbHNlJTJDJTIybmFtZSUyMiUzQSUyMm1hdGhzLmpzJTIyJTdEJTVEJTJDJTIyb3B0aW9ucyUyMiUzQSU3QiUyMm91dHB1dCUyMiUzQSU3QiUyMmZvcm1hdCUyMiUzQSUyMmVzJTIyJTdEJTJDJTIydHJlZXNoYWtlJTIyJTNBdHJ1ZSU3RCU3RA==

Expected Behaviour

Ember application should build without errors

Actual Behaviour

Building the Ember / Embroider app throws this 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.
    at requireWithFriendlyError (/redacted/altbase/ember-simple-auth-token/addon/node_modules/rollup/dist/native.js:59:9)
    at Object.<anonymous> (/redacted/altbase/ember-simple-auth-token/addon/node_modules/rollup/dist/native.js:68:76)
    ... 3 lines matching cause stack trace ...
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/redacted/altbase/ember-simple-auth-token/addon/node_modules/rollup/dist/shared/parseAst.js:12:19)
    at Module._compile (node:internal/modules/cjs/loader:1356:14) {
  [cause]: Error: Cannot find module '@rollup/rollup-darwin-arm64'
  Require stack:
  - /redacted/addon/node_modules/rollup/dist/native.js
  - /redacted/addon/node_modules/rollup/dist/shared/parseAst.js
  - /redacted/addon/node_modules/rollup/dist/shared/rollup.js
  - /redacted/addon/node_modules/rollup/dist/bin/rollup
at requireWithFriendlyError (/redacted/addon/node_modules/rollup/dist/native.js:41:10)
      at Object.<anonymous> (/redacted/addon/node_modules/rollup/dist/native.js:68:76)
      at Module._compile (node:internal/modules/cjs/loader:1356:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
      at Module.load (node:internal/modules/cjs/loader:1197:32)
      at Module._load (node:internal/modules/cjs/loader:1013:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/redacted/addon/node_modules/rollup/dist/native.js',
      '/redacted/addon/node_modules/rollup/dist/shared/parseAst.js',
      '/redacted/addon/node_modules/rollup/dist/shared/rollup.js',
      '/redacted/addon/node_modules/rollup/dist/bin/rollup'
    ]
  }

node 18.19.1, npm 10.5.1

"dependencies": {
    "@embroider/addon-shim": "^1.8.7",
    "decorator-transforms": "^1.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.23.6",
    "@babel/eslint-parser": "^7.23.3",
    "@babel/runtime": "^7.17.0",
    "@embroider/addon-dev": "^4.1.0",
    "@rollup/plugin-babel": "^6.0.4",
    "babel-plugin-ember-template-compilation": "^2.2.1",
    "concurrently": "^8.2.2",
    "eslint": "^8.56.0",
    "eslint-plugin-ember": "^11.12.0",
    "eslint-plugin-import": "^2.29.1",
    "eslint-plugin-n": "^16.4.0",
    "rollup": "~4.14.1",
    "rollup-plugin-copy": "^3.5.0"
  },

Reverting rollup 4.16.4 to 4.14.3 fixes the error.

The Ember app build process should not throw MODULE_NOT_FOUND errors. Deleting package-lock.json and node_modules folder and reinstalling all dependencies does not fix the error.

@lukastaegert
Copy link
Member

Weird. I cannot see a change that should prompt this.

$ npm show @rollup/rollup-darwin-arm64 versions
[
  ..., '4.16.1',   '4.16.2',
  '4.16.3',   '4.16.4'
]

$ npm show rollup@4.16.4 optionalDependencies
{
  fsevents: '~2.3.2',
  '@rollup/rollup-darwin-arm64': '4.16.4',
  '@rollup/rollup-android-arm64': '4.16.4',
  '@rollup/rollup-win32-arm64-msvc': '4.16.4',
  '@rollup/rollup-linux-arm64-gnu': '4.16.4',
  '@rollup/rollup-linux-arm64-musl': '4.16.4',
  '@rollup/rollup-android-arm-eabi': '4.16.4',
  '@rollup/rollup-linux-arm-gnueabihf': '4.16.4',
  '@rollup/rollup-linux-arm-musleabihf': '4.16.4',
  '@rollup/rollup-win32-ia32-msvc': '4.16.4',
  '@rollup/rollup-linux-riscv64-gnu': '4.16.4',
  '@rollup/rollup-linux-powerpc64le-gnu': '4.16.4',
  '@rollup/rollup-linux-s390x-gnu': '4.16.4',
  '@rollup/rollup-darwin-x64': '4.16.4',
  '@rollup/rollup-win32-x64-msvc': '4.16.4',
  '@rollup/rollup-linux-x64-gnu': '4.16.4',
  '@rollup/rollup-linux-x64-musl': '4.16.4'
}

So the version exists and is properly listed as an optional dependency, just like with the versions before.

@lukastaegert
Copy link
Member

Could you check again if the issue persists with the latest release? While I am not sure how it could have caused this issue, there were some problems introduced by GitHub switching to ARM Mac runners that should be addressed there.

@ChrisN-transnexus
Copy link
Author

Seems to be fixed in v 4.17.2, thanks.

@ChrisN-transnexus
Copy link
Author

Closed

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

No branches or pull requests

2 participants