The notion of a Jiki Ninki or Flesh-eating Goblin appears in several forms within Japanese folk tales. The story below is a very old and original version which conjures skin-tingles at the thought of encountering delapitated shrine hermitages along darakened mountainous passages. Here's why...
From Lafcadio Hearn's classic Kwaidan, 1904.
Once, when Muso Kokushi, a priest of the Zen sect, was journeying alone through the province of Mino, he lost his way in a mountain-district where there was nobody to direct him. For a long time he wandered about helplessly; and he was beginning to despair of finding shelter for the night, when he perceived, on the top of a hill lighted by the last rays of the sun, one of those little hermitages, called anjitsu, which are built for solitary priests. It seemed to be in ruinous condition; but he hastened to it eagerly, and found that it was inhabited by an aged priest, from whom he begged the favor of a night's lodging. This the old man harshly refused; but he directed Muso to a certain hamlet, in the valley adjoining where lodging and food could be obtained.
Muso found his way to the hamlet, which consisted of less than a dozen farm-cottages; and he was kindly received at the dwelling of the headman. Forty or fifty persons were assembled in the principal apartment, at the moment of Muso's arrival; but he was shown into a small separate room, where he was promptly supplied with food and bedding. Being very tired, he lay down to rest at an early hour; but a little before midnight he was roused from sleep by a sound of loud weeping in the next apartment. Presently the sliding-screens were gently pushed apart; and a young man, carrying a lighted lantern, entered the room, respectfully saluted him, and said:--
"Reverend Sir, it is my painful duty to tell you that I am now the responsible head of this house. Yesterday I was only the eldest son. But when you came here, tired as you were, we did not wish that you should feel embarrassed in any way: therefore we did not tell you that father had died only a few hours before. The people whom you saw in the next room are the inhabitants of this village: they all assembled here to pay their last respects to the dead; and now they are going to another village, about three miles off,-- for by our custom, no one of us may remain in this village during the night after a death has taken place. We make the proper offerings and prayers; -- then we go away, leaving the corpse alone. Strange things always happen in the house where a corpse has thus been left: so we think that it will be better for you to come away with us. We can find you good lodging in the other village. But perhaps, as you are a priest, you have no fear of demons or evil spirits; and, if you are not afraid of being left alone with the body, you will be very welcome to the use of this poor house. However, I must tell you that nobody, except a priest, would dare to remain here tonight."
Muso made answer:--
"For your kind intention and your generous hospitality and am deeply grateful. But I am sorry that you did not tell me of your father's death when I came; -- for, though I was a little tired, I certainly was not so tired that I should have found difficulty in doing my duty as a priest. Had you told me, I could have performed the service before your departure. As it is, I shall perform the service after you have gone away; and I shall stay by the body until morning. I do not know what you mean by your words about the danger of staying here alone; but I am not afraid ofghosts or demons: therefore please to feel no anxiety on my account."
The young man appeared to be rejoiced by these assurances, and expressed his gratitude in fitting words. Then the other members of the family, and the folk assembled in the adjoining room, having been told of the priest's kind promises, came to thank him,-- after which the master of the house said:--
"Now, reverend Sir, much as we regret to leave you alone, we must bid you farewell. By the rule of our village, none of us can stay here after midnight. We beg, kind Sir, that you will take every care of your honorable body, while we are unable to attend upon you. And if you happen to hear or see anything strange during our absence, please tell us of the matter when we return in the morning."
All then left the house, except the priest, who went to the room where the dead body was lying. The usual offerings had been set before the corpse; and a small Buddhist lamp -- tomyo -- was burning. The priest recited the service, and performed the funeral ceremonies,-- after which he entered into meditation. So meditating he remained through several silent hours; and there was no sound in the deserted village. But, when the hush of the night was at its deepest, there noiselessly entered a Shape, vague and vast; and in the same moment Muso found himself without power to move or speak. He saw that Shape lift the corpse, as with hands, devour it, more quickly than a cat devours a rat,-- beginning at the head, and eating everything: the hair and the bones and even the shroud. And the monstrous Thing, having thus consumed the body, turned to the offerings, and ate them also. Then it went away, as mysteriously as it had come.
When the villagers returned next morning, they found the priest awaiting them at the door of the headman's dwelling. All in turn saluted him; and when they had entered, and looked about the room, no one expressed any surprise at the disappearance of the dead body and the offerings. But the master of the house said to Muso:--
"Reverent Sir, you have probably seen unpleasant things during the night: all of us were anxious about you. But now we are very happy to find you alive and unharmed. Gladly we would have stayed with you, if it had been possible. But the law of our village, as I told you last evening, obliges us to quit our houses after a death has taken place, and to leave the corpse alone. Whenever this law has been broken, heretofore, some great misfortune has followed. Whenever it is obeyed, we find that the corpse and the offerings disappear during our absence. Perhaps you have seen the cause."
Then Muso told of the dim and awful Shape that had entered the death-chamber to devour the body and the offerings. No person seemed to be surprised by his narration; and the master of the house observed:--
"What you have told us, reverend Sir, agrees with what has been said about this matter from ancient time."
Muso then inquired:--
"Does not the priest on the hill sometimes perform the funeral service for your dead?"
"What priest?" the young man asked.
"The priest who yesterday evening directed me to this village," answered Muso. "I called at his anjitsu on the hill yonder. He refused me lodging, but told me the way here."
The listeners looked at each other, as in astonishment; and, after a moment of silence, the master of the house said:--
"Reverend Sir, there is no priest and there is no anjitsu on the hill. For the time of many generations there has not been any resident-priest in this neighborhood."
Muso said nothing more on the subject; for it was evident that his kind hosts supposed him to have been deluded by some goblin. But after having bidden them farewell, and obtained all necessary information as to his road, he determined to look again for the hermitage on the hill, and so to ascertain whether he had really been deceived. He found the anjitsu without any difficulty; and, this time, its aged occupant invited him to enter. When he had done so, the hermit humbly bowed down before him, exclaiming:-- "Ah! I am ashamed ! -- I amvery much ashamed! -- I am exceedingly ashamed!"
"You need not be ashamed for having refused me shelter," said Muso. "you directed me to the village yonder, where I was very kindly treated; and I thank you for that favor.
"I can give no man shelter," the recluse made answer; -- and it is not for the refusal that I am ashamed. I am ashamed only that you should have seen me in my real shape,-- for it was I who devoured the corpse and the offerings last night before your eyes... Know, reverend Sir, that I am a jikininki,  -- an eater of human flesh. Have pity upon me, and suffer me to confess the secret fault by which I became reduced to this condition.
"A long, long time ago, I was a priest in this desolate region. There was no other priest for many leagues around. So, in that time, the bodies of the mountain-folk who died used to be brought here,-- sometimes from great distances,-- in order that I might repeat over them the holy service. But I repeated the service and performed the rites only as a matter of business; -- I thought only of the food and the clothes that my sacred profession enabled me to gain. And because of this selfish impiety I was reborn, immediately after my death, into the state of a jikininki. Since then I have been obliged to feed upon the corpses of the people who die in this district: every one of them I must devour in the way that you saw last night... Now, reverend Sir, let me beseech you to perform a Segaki-service  for me: help me by your prayers, I entreat you, so that I may be soon able to escape from this horrible state of existence"...
No sooner had the hermit uttered this petition than he disappeared; and the hermitage also disappeared at the same instant. And Muso Kokushi found himself kneeling alone in the high grass, beside an ancient and moss-grown tomb of the form called go-rin-ishi,  which seemed to be the tomb of a priest.