I dont understand what’s wrong, this happens to all scripts including new created.
You say “No monobehaviour scripts in the file” but what about the second part it warns you about?
the name matches the file name, right?
Well, console content? Filename doesn’t contain special characters, space or other things, right? We don’t know what’s happening, we only see what you share, which is not too much so far. (Although more than some other people, so that’s great)
Also no duplicate file with the same name, right? No errors? Unity could compile your application? What happens if you hit the play button?
The problem was that there was an error in one scripts, my question now is, I can not add any script to any gameobject if one script has an error?
You ask the question as if you want to ignore the error. Fix the error and all will be good.
Unity cannot just ignore an error and move on. It has no way to do things like enter play mode or anything because the compilation failed.
As @MelvMay pointed out, programming doesn’t work like that, so it’s correct. You only can reliably(!) see/handle/attach Components if there is no fatal error in your application. If you see red messages in the console from your application, then fixing it should be your #1 priority. Then you can move on adding components.