Open ramesh901 opened 7 years ago
Likewise, unsure of how to resolve this error. I created a blank .env file in the project directory which gives a different warning, but I've no idea what to put in the .env file
Hi I got different error in this part. After added an empty .env file I still got this message when run "npm run start-dev":
This is my package.json file:
How can I fix this error?
I made it to the end. Pretty good tutorial! Post you dir structure, maybe i can help.
Ok. I've figured out the problem and fixed it. Here is what I did...
The "No ENV file found" warning.
First, I created a file with the name .env that I later added some database info to. That fixed the No ENV warning.
On to the "Cannot read property '1' of null" warning.
I had to dig around a bit on node-foreman and Procfile. I eventually saw that in the Procfile, I also copied the first line, "//Procfile". That turned out to be the problem. There should only be the "web: ..." and "api: ..." commands, so I removed the offending line and ran npm run start-dev again and it worked like it should.
Hope that this helps!
Thanks Gero for your detailed research,
Just remove //Procfile from Procfile and it should start the dev server, but there will be two warnings that will be caused by Mongoose latest version ~5. This should not be a blocker though.
I am in the middle section of the tutorial. I created procfile and updated package.json with "“start-dev”: “nf start -p 3000”. When I run the command 'npm run start-dev' I am getting the warning No Env file found and cannot read property 1 of null. I able to run only the react server and not the api server.