Error while building new plugin, cannot find dist/server

I’m running into this problem but only in production. I tried both

"scripts": {
    "prebuild": "cd src/plugins/<plugin name> && npm run build",
  },

and

"scripts": {
    "prebuild": "cd src/plugins/<plugin name> && npm install && npm run build",
  },

but I get this error: “sh: 1: strapi-plugin: not found”. Anyone else having a similar issue in production?