3

I built a small react app using the create-react-app boiler plate. When serving the content with npm run everything works fine.

But now I tried running the builder for the first time because I am at a point where I would like to show a demo. I tried running npm run build but it errors out. Here is the npm log:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'build' ] 2 info using [email protected] 3 info using [email protected] 4 verbose config Skipping project config: /Users/falks/.npmrc. (matches userconfig) 5 verbose stack Error: ENOENT: no such file or directory, open '/Users/falks/package.json' 5 verbose stack at Error (native) 6 verbose cwd /Users/falks 7 error Darwin 15.6.0 8 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" 9 error node v5.1.1 10 error npm v3.3.12 11 error path /Users/falks/package.json 12 error code ENOENT 13 error errno -2 14 error syscall open 15 error enoent ENOENT: no such file or directory, open '/Users/falks/package.json' 15 error enoent This is most likely not a problem with npm itself 15 error enoent and is related to npm not being able to find a file. 16 verbose exit [ -2, true ]

It appears that it is looking for a package.json outside of my development folder? Any hint how to get the builder to run?

Thank you.

2
  • Are you sure you are running the command in the application directory? Commented Dec 19, 2016 at 7:52
  • Yes, same directory I run start and do all my git stuff from. Commented Dec 19, 2016 at 8:40

1 Answer 1

1

I think you may be in the wrong folder because of this line in your error

ENOENT: no such file or directory, open '/Users/falks/package.json'

You need to run that command from the same folder that the package.json file is - typically the root folder of your project... it looks like you are trying to run it from your home folder.

-- edited: lol, why did I respond to a question that is over a year old and Dan Abramov already answered - please ignore me

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.