'How do I fix an error thrown during NPM Install?

During directus-main install I get this error. https://github.com/bereikme/directus

\[2022-03-31 07:07:51\] Require stack:
\[2022-03-31 07:07:51\] - /workspace/api/cli.js
\[2022-03-31 07:07:51\]     at Function.Module.\_resolveFilename (node:internal/modules/cjs/loader:933:15)
\[2022-03-31 07:07:51\]     at Function.Module.\_load (node:internal/modules/cjs/loader:778:27)
\[2022-03-31 07:07:51\]     at Module.require (node:internal/modules/cjs/loader:1005:19)
\[2022-03-31 07:07:51\]     at require (node:internal/modules/cjs/helpers:102:18)
\[2022-03-31 07:07:51\]     at Object.\<anonymous\> (/workspace/api/cli.js:2:1)
\[2022-03-31 07:07:51\]     at Module.\_compile (node:internal/modules/cjs/loader:1101:14)
\[2022-03-31 07:07:51\]     at Object.Module.\_extensions..js (node:internal/modules/cjs/loader:1153:10)
\[2022-03-31 07:07:51\]     at Module.load (node:internal/modules/cjs/loader:981:32)
\[2022-03-31 07:07:51\]     at Function.Module.\_load (node:internal/modules/cjs/loader:822:12)
\[2022-03-31 07:07:51\]     at Function.executeUserEntryPoint \[as runMain\] (node:internal/modules/run_main:81:12) {
\[2022-03-31 07:07:51\]   code: 'MODULE_NOT_FOUND',
\[2022-03-31 07:07:51\]   requireStack: \[ '/workspace/api/cli.js' \]

I'm getting the error above while trying to run the Directus App on DigitalOcean.

This is the package-lock.json I'm using. https://raw.githubusercontent.com/bereikme/directus/main/package-lock.json

It's identical to the one in the Directus repository, so it's a default one. If you check the documentation on Directus, it does show a different setup though. https://docs.directus.io/getting-started/installation/digitalocean-app-platform/

https://raw.githubusercontent.com/bereikme/directus/main/package-lock.json

Is there any way to fix this issue?

I tried change npm version, force to copy file to the position, but not worked. Please help me fix this issue.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source