Reputation: 11
The error keeps coming up every time i use npm start. i am a complete beginner
Upvotes: -1
Views: 503
Reputation: 756
You need to run your command from directory which contains package.json. Probably you will also need to use command nmp run start
instead. By the way folders with spaces in names may cause some problems later. I would recommend to remove spaces.
Upvotes: 0
Reputation: 61
You have created a my app
folder inside another my app
folder, and your working directory is the first folder which doesn't have a package.json file. You must change your terminal directory to inner my app
folder.
Upvotes: 0
Reputation: 501
Congrats on your first react app!
The npm start
command looks in your package.json file for a script. It will look something like this:
'scripts': {
'start': 'node app.js'
}
Your error is saying that your terminal can't find the package.json file at all. Make sure your terminal is in the same directory as your package.json file. If you type the ls
command in your terminal it should show your package.json file. If you don't see it, you can use cd ..
to move up a directory, or cd {folderName}
to move down a directory. You want to be in the my-app directory. The pwd
command will print the directory you're currently in.
Upvotes: 0
Reputation: 2466
Traverse to my-app folder which is inside your My App folder and then run npm start
Upvotes: 2