Strapi crashed and cannot restart it

my strapi app crashed while I was editing the components list and now I cannot restart it.
the setup is basic, as I just started with:

 npx create-strapi-app my-project --quickstart

I am getting the following error when trying to restart:

internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '/root/.npm/_npx/1251/lib/node_modules/strapi/lib/utils/success.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! strapi@3.6.6 postinstall: `node lib/utils/success.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the strapi@3.6.6 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-08-11T14_37_01_026Z-debug.log
Install for strapi@latest failed with code 1

Please help me out

Hi @tudorg

Can you share what Operating System you are on and what Node/NPM version you are using?

Hi @tudorg please share a few things:

  1. Your Node Version
  2. Your NPM version
  3. What operating system you’re running on.

Also, did you try anything to get it running again or is this the first error you saw once it failed?

  1. v10.19.0
  2. 6.14.4
  3. Ubuntu 20.04 (LTS) x64 (on DigitalOcean)

@Richard_Nsama this is the first error

So for a start, could you attempt to update your Node version to either version 12 or 14 as stipulated in the general deployment guidelines here, after that, please delete your package-lock.json, run npm install again and try to start your server again?

OK, done that. Now I get this

npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN bootstrap@4.6.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-iso-date@3.6.1 requires a peer of graphql@^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-type-long@0.1.1 requires a peer of graphql@^0.9.1 || ^0.10.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.

audited 1790 packages in 11.939s

118 packages are looking for funding
  run `npm fund` for details

found 4 vulnerabilities (2 moderate, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details

Those are fine, just warnings. try running either an npm run build or yarn build then check by running npm run develop or yarn develop

it seems that there is an issue with a component I created, right? Note that I only used the UI to create those components & collections.
Shall I delete it from the /components folder?

root@george-cms-strapi:~/my-project# npx strapi start
[2021-08-11T15:22:18.347Z] debug ⛔️ Server wasn't able to start properly.
[2021-08-11T15:22:18.349Z] error Error: There can be only one type named "ComponentStaticFilterInput".

There can be only one type named "editComponentStaticFilterInput".

Field "editComponentStaticFilterInput.id" can only be defined once.
    at assertValidSDL (/root/my-project/node_modules/graphql/validation/validate.js:107:11)
    at Object.buildASTSchema (/root/my-project/node_modules/graphql/utilities/buildASTSchema.js:45:34)
    at Object.buildSchemaFromTypeDefinitions (/root/my-project/node_modules/graphql-tools/dist/generate/buildSchemaFromTypeDefinitions.js:25:28)
    at makeExecutableSchema (/root/my-project/node_modules/graphql-tools/dist/makeExecutableSchema.js:26:29)
    at Object.generateSchema (/root/my-project/node_modules/strapi-plugin-graphql/services/schema-generator.js:101:18)
    at Object.initialize (/root/my-project/node_modules/strapi-plugin-graphql/hooks/graphql/index.js:76:74)
    at /root/my-project/node_modules/strapi/lib/hooks/index.js:37:28

you’ll need to use the npm run start or npm run develop not npx

result is the same:

root@george-cms-strapi:~/my-project# npm run start

> my-project@0.1.0 start /root/my-project
> strapi start

[2021-08-11T17:13:43.444Z] debug ⛔️ Server wasn't able to start properly.
[2021-08-11T17:13:43.445Z] error Error: There can be only one type named "ComponentStaticFilterInput".

There can be only one type named "editComponentStaticFilterInput".

Field "editComponentStaticFilterInput.id" can only be defined once.
    at assertValidSDL (/root/my-project/node_modules/graphql/validation/validate.js:107:11)
    at Object.buildASTSchema (/root/my-project/node_modules/graphql/utilities/buildASTSchema.js:45:34)
    at Object.buildSchemaFromTypeDefinitions (/root/my-project/node_modules/graphql-tools/dist/generate/buildSchemaFromTypeDefinitions.js:25:28)
    at makeExecutableSchema (/root/my-project/node_modules/graphql-tools/dist/makeExecutableSchema.js:26:29)
    at Object.generateSchema (/root/my-project/node_modules/strapi-plugin-graphql/services/schema-generator.js:101:18)
    at Object.initialize (/root/my-project/node_modules/strapi-plugin-graphql/hooks/graphql/index.js:76:74)
    at /root/my-project/node_modules/strapi/lib/hooks/index.js:37:28
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-project@0.1.0 start: `strapi start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the my-project@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-08-11T17_13_43_467Z-debug.log

Is your project code somewhere I can take a look at it (like a github repo), even if it’s a private repo you can add me via my github username: derrickmehaffy

OK, done. Thx a lot for the support

@DMehaffy I managed to fix it in the meanwhile, by removing the “filter” attributes from a component (from the JSON file directly) and then restarting Strapi

1 Like