Gautamrk
Gautamrk

Reputation: 1244

npm Start and "npm run client" is not working in Node

I am trying to run a Node js program as defined in Github probyto

i am following all the steps defined in the above github link but when i try to run

npm run client

it gives me a error as

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Gautam\AppData\Roaming\npm-cache\_logs\2021-01-11T07_55_54_943Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] client: `npm start --prefix client`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Gautam\AppData\Roaming\npm-cache\_logs\2021-01-11T07_55_54_976Z-debug.log

I have already tried some solutions like

updating node/ npm

deleting node modules and packagelock.json file and then npm install

npm update

but nothing seems to work . can anyone help me run this . any help is appreciated

Upvotes: 2

Views: 3656

Answers (5)

Huzaifa Qidwai
Huzaifa Qidwai

Reputation: 239

I have the same problem, I resolved by using below commands

sudo npm cache clean -f

sudo npm install -g n

sudo n stable

To upgrade to latest version (and not current stable) version, you can use

sudo n latest

Upvotes: 1

msilucifer
msilucifer

Reputation: 746

Please try like this in client folder.

STEP #1:

npm cache clean --force

STEP #2:

Since you are using Windows, delete node_modules folder and package_lock.json file manually.

STEP #3:

npm install

STEP #4:

npm start

Many people are using this method to solve situations like you.

Hope this will be helpful for you.

Upvotes: 1

ale917k
ale917k

Reputation: 1768

I cloned the repo and tested it out for you and it doesn't seem to have any issue; all you need to do to make the client work is the following:

npm i; npm run client-install; npm run client

And with that you should see your react app compiling successfully

If, for some reason, the previous didn't work out for you, you can retry after cleaning up both your node_modules and package-lock.json with the following (I know you tried already, but give this line of code a shot):

rm -rf node_modules package-lock.json; cd client; rm -rf node_modules package-lock.json; cd ..; npm i; npm run client-install; npm run client

Last try I'd give, if still not working, is about installing the modules directly from the client folder, as such:

cd client; rm -rf node_modules package-lock.json; npm i; npm start

With these steps it should definitely be up and running successfully, but if not you may need to debug a bit further.

For that, I specifically mean to check there are no issues while running the module installation and finally check if you are downloading the modules from the right registry. To do that, just run npm config ls -l on any folder, and check to have the registry property set as "https://registry.npmjs.org/"

Hope will help!

Upvotes: 1

imaginate
imaginate

Reputation: 549

The getting started page on their README.md shows you the steps you need to follow.

Simplified:

Run:

npm run client-install

(if using windows) Then run:

copy config/keys.sample.js config/keys.js

Or if using Mac, run:

cp config/keys.sample.js config/keys.js

Only then can you run the development server:

npm run dev

Upvotes: 3

Feuermann
Feuermann

Reputation: 344

It seems, you don't install all needed packages. In documentation for project have some step those you skip. After install packages you need run command for install additional packages.

npm run client-install

And after this run project with:

npm run client

Upvotes: 0

Related Questions