Install macOS High Sierra.app does not appear to be a valid OS installer application
Here's what you need to do (example follows High Sierra):


Format a USB stick with format Mac OS Extended, scheme GUID Partition Map and name it Untitled
Get and run the installer from https://support.apple.com/en-us/HT208969
Run through the installer all until you are asked to restart, but then exit the installer
sudo mkdir /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport
sudo cp -R /macOS\ Install\ Data/ Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled


And... if you get an error while installing OSX, e.g. "Installer resource error", then follow these step:


ctrl+command+shift+alt+H and open the Terminal
cp -rf /Volumes/Install\ macOS\ High\ Sierra/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/* /Volumes/Untitled/macOS\ install\ data/
Reboot!


You're welcome!