Once when I installed some npm package, all next-related API(such as link, image, and so on) showed errors saying they cannot be found.
So as to fix them, I had to add them again.
At that time,
yarn add next
this single line fixed the problem!
Hope this would help somebody too:)