Одна из ошибок при команде npm run dev.
Ошибка
(venv) Dream@MBP svelte % npm run dev
> app@1.0.0 dev
> rollup -c -w[!] Error: Cannot find module ‘serialize-javascript’
Require stack:
— /Users/Dream/Desktop/svelte/node_modules/rollup-plugin-terser/rollup-plugin-terser.js
— /Users/Dream/Desktop/svelte/rollup.config.js
— /Users/Dream/Desktop/svelte/node_modules/rollup/dist/shared/loadConfigFile.js
— /Users/Dream/Desktop/svelte/node_modules/rollup/dist/bin/rollup
Error: Cannot find module ‘serialize-javascript’
Require stack:
— /Users/Dream/Desktop/svelte/node_modules/rollup-plugin-terser/rollup-plugin-terser.js
— /Users/Dream/Desktop/svelte/rollup.config.js
— /Users/Dream/Desktop/svelte/node_modules/rollup/dist/shared/loadConfigFile.js
— /Users/Dream/Desktop/svelte/node_modules/rollup/dist/bin/rollup
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
at Function.Module._load (node:internal/modules/cjs/loader:773:27)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.(/Users/Dream/Desktop/svelte/node_modules/rollup-plugin-terser/rollup-plugin-terser.js:3:19)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Object.require.extensions.[as .js] (/Users/Dream/Desktop/svelte/node_modules/rollup/dist/shared/loadConfigFile.js:563:13)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Function.Module._load (node:internal/modules/cjs/loader:828:14)
Решение
Мне помогло обновить все пакеты по инструкции.