ERR_MODULE_NOT_FOUND on npm run build

I've executed npm run build as I have a layout issues (2 weeks can't upgrade our app to v3) and I got the following error
node:internal/errors:491
ErrorCaptureStackTrace(err);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/vagrant/node_modules/vite/dist/node/cli.js' imported from /vagrant/node_modules/vite/bin/vite.js
at new NodeError (node:internal/errors:400:5)
at finalizeResolution (node:internal/modules/esm/resolve:326:11)
at moduleResolve (node:internal/modules/esm/resolve:945:10)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ESMLoader.import (node:internal/modules/esm/loader:525:22)
at importModuleDynamically (node:internal/modules/esm/translators:110:35)
at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14) {
code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v18.13.0
node:internal/errors:491
ErrorCaptureStackTrace(err);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/vagrant/node_modules/vite/dist/node/cli.js' imported from /vagrant/node_modules/vite/bin/vite.js
at new NodeError (node:internal/errors:400:5)
at finalizeResolution (node:internal/modules/esm/resolve:326:11)
at moduleResolve (node:internal/modules/esm/resolve:945:10)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ESMLoader.import (node:internal/modules/esm/loader:525:22)
at importModuleDynamically (node:internal/modules/esm/translators:110:35)
at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14) {
code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v18.13.0
I see that the folder node_modules/vite/dist/node/ does not exist in my system. Is there something that I can do, like to reinstall some module or to do something else to fix that issue?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server