Warm tip: This article is reproduced from serverfault.com, please click

ENOENT: no such file or directory, open 'C:\Users\subwo\package.json'

发布于 2020-12-07 17:06:00

I'm new to all this and I'm taking a Blockchain course to learn all I can from scratch. So the problem is that the guy from the course made me install the following:

Node.js: https://nodejs.org/en/
Ganache: https://www.trufflesuite.com/ganache
Truffle: https://www.trufflesuite.com/
Metamask

And also this resource:

Starter Kit: https://github.com/dappuniversity/starter_kit

So I installed all of that, including the starter kit to be able to follow along on the demo project. The thing is, the guy runs the starter kit app from the command prompt with the line "npm run start", so the app automatically opened in his browser. But when I do it, I get an ENOENT error which as I read, it indicates that a file is missing, I'll show a screenshot below:

cmd error when trying to run app

When I go to the folder in which I'm sure the "missing file" is located, I can see that it's there, in the folder where the whole app is installed:

file directory

I don't know if the cmd is searching in the right folder or what, and I honestly have no idea how to fix this. If anyone can help I'd deeply appreciate it, please let me know if you need to see the code of the app or anything else.

Questioner
Leon
Viewed
0
devintark 2020-12-08 01:14:39

Looks like your package.json is in C:\Users\subwo\ethswap.

cd ethswap
npm run start

To eleborate. You're running npm run start from C:\Users\subwo, but your project directory is really in C:\Users\subwo\ethswap. So you need go one more directory down before running.