I have followed the following steps, but it gives an error, I don't know which step I've got wrong: Download and install Unreal Engine. Currently compatible with UE 4.27-5.2.
Download and install Visual Studio 2015 / 2017 / 2019 Community or the latest Xcode depending on your operating system. If in doubt about the Visual Studio version, you may want to choose according to the list here. When installing and setting up Visual Studio, please follow the guide here, section Options for a New Visual Studio Installation.
Create a new empty C++ code project in the Unreal Engine Editor. You can use Blueprint in your C++ project, but a Blueprints only project will not work because the Spine plugin is written in C++.
Clone the spine-runtimes Git repository. If you don't want to use Git, download the latest version as a ZIP and unpack it.
In your project folder, create a subfolder called Plugins.
Copy the contents of spine-runtimes/spine-ue4/Plugins/ to your project's Plugins/ folder.
Copy the folder spine-runtimes/spine-cpp/spine-cpp to your project's Plugins/SpinePlugin/Source/SpinePlugin/Public/ folder.
Add SpinePlugin to PublicDependencyModuleNames in your project's Build.cs file.