Replies: 4 comments 2 replies
-
And it's supering that my old projects created by the same way is still avaliable |
Beta Was this translation helpful? Give feedback.
-
I guess you are using rosetta when calling npm, but not using rosetta when calling node. |
Beta Was this translation helpful? Give feedback.
-
解决方案 |
Beta Was this translation helpful? Give feedback.
-
Adding "@rollup/rollup-darwin-arm64" as dependency fixes the issue. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
After I did:
Error: Cannot find module @rollup/rollup-darwin-arm64. 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/sagekwun/code/live-player/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:89:9)
at Object. (/Users/sagekwun/code/live-player/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:98:76)
... 3 lines matching cause stack trace ...
at Module._load (node:internal/modules/cjs/loader:930:12)
at ModuleWrap. (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:
at Module._resolveFilename (node:internal/modules/cjs/loader:1047:15)
at Module._load (node:internal/modules/cjs/loader:893:27)
at Module.require (node:internal/modules/cjs/loader:1113:19)
at require (node:internal/modules/cjs/helpers:103:18)
at requireWithFriendlyError (/Users/sagekwun/code/live-player/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:71:10)
at Object. (/Users/sagekwun/code/live-player/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js:98:76)
at Module._compile (node:internal/modules/cjs/loader:1226:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
at Module.load (node:internal/modules/cjs/loader:1089:32)
at Module._load (node:internal/modules/cjs/loader:930:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/sagekwun/code/live-player/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/native.js'
]
}
}
I tried
npm i
again after removing both package-lock.json and node_modules directory, but it didn't workReproduction
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Logs
vite --debug
/Users/sagekwun/.nvm/versions/node/v18.14.0/lib/node_modules/vite/node_modules/rollup/dist/native.js:89
throw new Error(
^
Error: Cannot find module @rollup/rollup-darwin-arm64. 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/sagekwun/.nvm/versions/node/v18.14.0/lib/node_modules/vite/node_modules/rollup/dist/native.js:89:9)
at Object. (/Users/sagekwun/.nvm/versions/node/v18.14.0/lib/node_modules/vite/node_modules/rollup/dist/native.js:98:76)
... 3 lines matching cause stack trace ...
at Module._load (node:internal/modules/cjs/loader:930:12)
at ModuleWrap. (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:
at Module._resolveFilename (node:internal/modules/cjs/loader:1047:15)
at Module._load (node:internal/modules/cjs/loader:893:27)
at Module.require (node:internal/modules/cjs/loader:1113:19)
at require (node:internal/modules/cjs/helpers:103:18)
at requireWithFriendlyError (/Users/sagekwun/.nvm/versions/node/v18.14.0/lib/node_modules/vite/node_modules/rollup/dist/native.js:71:10)
at Object. (/Users/sagekwun/.nvm/versions/node/v18.14.0/lib/node_modules/vite/node_modules/rollup/dist/native.js:98:76)
at Module._compile (node:internal/modules/cjs/loader:1226:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
at Module.load (node:internal/modules/cjs/loader:1089:32)
at Module._load (node:internal/modules/cjs/loader:930:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/sagekwun/.nvm/versions/node/v18.14.0/lib/node_modules/vite/node_modules/rollup/dist/native.js'
]
}
}
Node.js v18.14.0
Validations
Beta Was this translation helpful? Give feedback.
All reactions