amplify publish got error Error: Cannot find module '@rollup/rollup-darwin-x64' #14096
Labels
hosting
Issues tied to hosting category
pending-response
Issue is pending response from the issue author
pending-triage
Issue is pending triage
Environment information
Describe the bug
run amplify publish got above error, tried rm -rf node_modules, and package-lock.json, and use yarn install, still got the same error.
Reproduction steps
testapp % amplify publish
✔ Successfully pulled backend environment dev from the cloud.
┌──────────┬─────────────────┬───────────┬───────────────────┐
│ Category │ Resource name │ Operation │ Provider plugin │
├──────────┼─────────────────┼───────────┼───────────────────┤
│ Hosting │ S3AndCloudFront │ No Change │ awscloudformation │
└──────────┴─────────────────┴───────────┴───────────────────┘
No changes detected
? Do you still want to publish the frontend? Yes
/Users/wenyan/projects/testapp/node_modules/rollup/dist/native.js:64
throw new Error(
^
Error: Cannot find module @rollup/rollup-darwin-x64. npm has a bug related to optional dependencies (npm/cli#4828). Please try
npm i
again after removing both package-lock.json and node_modules directory.at requireWithFriendlyError (/Users/wenyan/projects/testapp/node_modules/rollup/dist/native.js:64:9)
at Object. (/Users/wenyan/projects/testapp/node_modules/rollup/dist/native.js:73:76)
at Module._compile (node:internal/modules/cjs/loader:1565:14)
at Object..js (node:internal/modules/cjs/loader:1708:10)
at Module.load (node:internal/modules/cjs/loader:1318:32)
at Function._load (node:internal/modules/cjs/loader:1128:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
at cjsLoader (node:internal/modules/esm/translators:263:5)
at ModuleWrap. (node:internal/modules/esm/translators:196:7) {
[cause]: Error: Cannot find module '@rollup/rollup-darwin-x64'
Require stack:
at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15)
at Function._load (node:internal/modules/cjs/loader:1075:27)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
at Module.require (node:internal/modules/cjs/loader:1340:12)
at require (node:internal/modules/helpers:138:16)
at requireWithFriendlyError (/Users/wenyan/projects/testapp/node_modules/rollup/dist/native.js:46:10)
at Object. (/Users/wenyan/projects/testapp/node_modules/rollup/dist/native.js:73:76)
at Module._compile (node:internal/modules/cjs/loader:1565:14)
at Object..js (node:internal/modules/cjs/loader:1708:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/wenyan/projects/testapp/node_modules/rollup/dist/native.js'
]
}
}
The text was updated successfully, but these errors were encountered: