Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Section in README.md file illustrating some issues encountered and their preventive measures #246

Open
rks-031 opened this issue Jun 26, 2023 · 0 comments

Comments

@rks-031
Copy link

rks-031 commented Jun 26, 2023

Issue 1.

After forking the repo and cloning the repo to the local device, when we follow the steps given in the readme, i.e,
cd client ->npm install ->cd ../server ->npm install ->npm run start

We get an error message saying: Missing script: “start” and many others as shown below:

err-1

The error message indicates that the npm script "start" is missing in the project's package.json file.
When we run the command npm run start, npm looks for a script named "start" in the "scripts" section of the package.json file.

To resolve this issue, we can do one of the following:

a] Checking the package.json file: Open the package.json file located in the project's root directory and ensure a "scripts" section with a "start" script is defined. Make sure the "start" script is defined correctly. If it's missing, we need to add it.

corr-11

b] Using a different script: If we intend to run a separate script instead of "start", we can modify the npm command accordingly. For example, if we have a script named "dev," we can run npm run dev instead.

corr-12

After making the necessary changes, save the package.json file and try rerunning the command.


Issue 2.

After implementing the above-mentioned changes when we try to run the command: npm run start, we may get the following message on the console:
Server is running on 5000
error occured while connecting

err-3

The same message may also appear if we try to run the project using the npm run dev command.

err-4

Here's how we can prevent it:

We can modify the method by which the index.js file is listening to the port by implementing the environment variable PORT so that the server can automatically find an available port for it and if not then it has the localhost as 5000.

corr-4


Thus, all these issues and their preventive measures should be mentioned in the README.md file by adding a specific section in it to help any user experiencing the same issues. An instance is shown below:

corr-readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant