Error: Cannot find module 'strapi' in Plesk but Strapi is running in CLI via ssha

System Information
  • latest:
  • Ubuntu 20.:
  • MySQL:
  • 16.14:
  • 8.3.1:
  • not installed:

I have big struggles to deploy strapi into my Server which is managed by plesk. I run the setup via Console and as stated there, the strapi server is running and all is fine. However strapi suggests me to localhost:1337/admin instead of the dummy domain which i originally defined. However i dont think that this is the problem. After i hit “NPM install” and run my site in dev-mode i get the error:

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module 'strapi'
Require stack:
- /var/www/vhosts/frosty-goldstine.82-165-106-228.plesk.page/strapi/server.js
- /usr/share/passenger/helper-scripts/node-loader.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.require (/usr/share/passenger/helper-scripts/node-loader.js:80:25)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/var/www/vhosts/frosty-goldstine.82-165-106-228.plesk.page/strapi/server.js:1:16)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/var/www/vhosts/frosty-goldstine.82-165-106-228.plesk.page/strapi/server.js',
    '/usr/share/passenger/helper-scripts/node-loader.js'
  ]
}

I dont know why this happens since in server.js is only the code which was suggested by strapi if you use plesk. How is “strapi” then not known?

Hello Tom,
have you found a solution for this issue? I’m currently trying to get Strapi to run on my server that is managed via plesk and I faced the same issue