Is there any way to use /enchant on a book in Minecraft
Solution 1:
/enchant
does not work on the stored enchantments of books. You can only use an enchanting table or anvil or set it directly in NBT like this:
/give @s enchanted_book{StoredEnchantments:[{id:"mending",lvl:1}]}