The present invention provides a prolinamide compound useful as a drug or the like and an industrially advantageous method for producing a piperazinyl pyrazole compound that is a production intermediate of the prolinamide compound. Specifically, the invention is a method for producing a compound represented by general formula (1) as represented by the following formula (where the symbols in the formula are the same as defined in the specification) or a salt thereof, wherein a compound represented by general formula (2) is produced, a pyrazole ring being formed via a reaction between a compound represented by general formula (3) and phosphorus pentasulfide and, once the compound represented by general formula (2) is deprotected, a carboxylate of a compound represented by general formula (6) is produced, the compound obtained by forming a carboxylic acid and a salt. WO2012165547A1