Exit code 1 and 2

I have a small website which is working on my computer but I can not deploy it with netlify. I checked the answers given but none of them work.
What i did is :

I overwriten the CI variable by CI=‘’ npm run build in the build command
I removed the build command in the package.json

But still it doesn’t work, here is the error :

Please if you could help me

Your paackage.json doesn’t have a script named build. You need to add one there.

I did this because they said in the doc than it could be the cause of the issue. But if I add it like you said I still have error, here is the message :

Check which directory your site is being built in and set that as the publish folder in Site settings.

Yes thank you this was the problem !!