creating animation made my each prefab spawn at same position

I create and empty object and make it move on z-axis and each 1 step on the axis create a cube but when i create an animation of cube, each cube being created at same position. how can i fix this? (also sorry for my bad english .d )

The animation of position of the cube is relative to its parent which seems to be the scene in your case. Your prefab should be an empty gameobject with the cube sets as a child of it: the animation will then be relative to the empty (which you could move anywhere in the scene independently from the animation).
This is something you can’t avoid in Unity when working with animations.