gulp task package-solution --ship should build a package prepared to be deployed to the prod environment.
gulp task throws an exception:

yo @microsoft/sharepointgulp build --shipgulp package-solution --shipIt doesn't matter whether property cdnBasePath in the file ./config/write-manifests.json is properly defined or not. The exception is always the same.
The workaround that I've found is to use command gulp serve --nobrowser --ship before executing gulp build --ship.
Any ideas? Am I doing something wrong?
gulp package-solution --ship depends on the gulp bundle --ship task. This dependency isn't explicit, but it is required for the package-solution task to run properly. If you don't run bundle first, you will the error that you're seeing.
Yep, that was the problem!
I've missed the gulp bundle --ship command.
It works now, thank you!
You're welcome!
Hi waldekmastykarz ,
I am facing the same issue even after i tried gulp bundle --ship.
Thanks, Pal
@rpalanivel83 what error do you see? Can you reproduce it in a clean solution?
Hi Waldekmastykarz,
Thanks for your response. I have resolved this issue. This is due to I had included external js in config.json without “http://“.
Thanks,Pal
Hi @waldekmastykarz I have choose web-part template wtih react. Now I'm running _gulp bundle --ship_ at that moment, I'm not able to find any additional file inside teams after that agian I run _gulp package-solution --ship_. So, it is throwing error. Please check it and try to resolve it.

Looking forward for your response.
Hello @waldekmastykarz The error is resolved. just I restart everything and try again now it is working fine.