typicode / json-server

Get a full fake REST API with zero coding in less than 30 seconds (seriously)
Other
72.83k stars 7.02k forks source link

Can't run json-server --watch db.json #1224

Open teffanymae opened 3 years ago

teffanymae commented 3 years ago

I can't run the server and this error shows:

C:\Users\ph2200009\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

The node_modules/node/bin/node has this: This file intentionally left blank

lucvsbraga commented 3 years ago

Solved

@teffanymae

I can't run the server and this error shows:

C:\Users\ph2200009\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

The node_modules/node/bin/node has this: This file intentionally left blank

Try using the following command:

npx json-server --watch db.json

crevulus commented 3 years ago

I ran into this same issue and @lucvsbraga 's solution solved it.

arthurrocha-dev commented 1 year ago

am also unable to execute the json-server --watch db.json command.

but in my case the error message displayed is:

json-server: command not found

I tried the command npx json-server --watch db.json, but the error remains I reinstalled the dependencies, checked the environment variables, but I couldn't find the reason for the error

Any tips?

arthurrocha-dev commented 1 year ago

I managed to fix the error with this command npm install -g json-server it installs json-server globally

erron522 commented 7 months ago

I keep on trying and continue to get this error message: --watch/-w can be omitted, JSON Server 1+ watches for file changes by default File db.json not found

manujayakumar commented 5 months ago

am also unable to execute the json-server --watch db.json command.

but in my case the error message displayed is:

json-server: command not found

I tried the command npx json-server --watch db.json, but the error remains I reinstalled the dependencies, checked the environment variables, but I couldn't find the reason for the error

Any tips?

Try, npx -g json-server -w db.json

Bhaskarpratik1234 commented 4 months ago

I am also unable to execute the json-server --watch db.json command.

but in my case the error message displayed is:

json-server: command not found

I tried the command npx json-server --watch db.json, but the error remains I reinstalled the dependencies, checked the environment variables, but I couldn't find the reason for the error and also trying the following command , but the error remains

npx json-server --watch db.json

Any tips?

83vinu commented 1 month ago

I keep on trying and continue to get this error message: --watch/-w can be omitted, JSON Server 1+ watches for file changes by default File db.json not found

for this i also faceing this same issue but i delete the data file and create a new file as datas and inside that i create a new file as dbs.json and after that i run the comment npx json-server -p 3000 -w datas/dbs.json it installd