Comments (9)
Looks like there is an issue in alpha version.
I can able to run normally using json-server@^0.17.3
from json-server.
I have a similar error.
Today I was trying to use json-server-auth, but end up with the error message.
Let me put the error first:
node:internal/modules/cjs/loader:1147
throw err;
^
Error: Cannot find module 'json-server'
Require stack:
- /usr/local/lib/node_modules/json-server-auth/dist/guards.js
- /usr/local/lib/node_modules/json-server-auth/dist/bin.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/usr/local/lib/node_modules/json-server-auth/dist/guards.js:6:20)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/local/lib/node_modules/json-server-auth/dist/guards.js',
'/usr/local/lib/node_modules/json-server-auth/dist/bin.js'
]
}
Node.js v20.11.0
In my project, I use npm init
to create package.json
then use npm install -D json-server json-server-auth
to create node_modules
, package-lock.json
and then create db.json
file in my project
and use sudo npm install -g json-server-auth
,
then I finally use json-server-auth db.json
, but it doesn't start the server,
showed the Error: Cannot find module 'json-server'
package.json code
{
"name": "vue-hangout-server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"json-server": "^1.0.0-alpha.22"
},
"dependencies": {
"express": "^4.18.2",
"json-server-auth": "^2.1.0"
}
}
I'm sure I install the latest version json-server and json-server-auth,
How can I make sure it finds module 'json-server'?
from json-server.
Can confirm, it works on 0.17.4 but not on the latest release
from json-server.
This issue exists for me also.
from json-server.
Да, проблема в версии. npm i [email protected] - решение
from json-server.
Related Issues (20)
- logger disabled by default in v1+; add option to enable logger? HOT 1
- Descending order not working HOT 3
- Descending order not working HOT 7
- 报错item['id'] = randomId();TypeError: Cannot create property 'id' on string 'a' HOT 1
- Pagination is not working as expected HOT 2
- Any way to filter data based on whether a field's value is in specified array? HOT 1
- How can I configure CORS. I see that @tinyhttp/cors is a dependency of JSON-Server HOT 7
- How do I encrypt json-server HTTP requests? HOT 1
- problem in pagination HOT 1
- Why doesn't the "name_like" parameter work in the latest version of the JSON server? HOT 1
- error/bug in the json server showing INT value as a STRING HOT 2
- Running "json-server --watch ./data/db.json --port 8000 --routes ./data/routes.json" results in the error "Unknown option '--routes'" HOT 5
- Issues with installing to non alpha version HOT 3
- How do I set up a unique road handler? HOT 1
- Error on : json-server --watch db.json HOT 1
- query parameter does not working HOT 4
- Weird behaviour when property "period" is in json mock data
- Steps to serve multiple json files with json-server HOT 3
- `_gte` and `_lte` doesn't work for dates HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-server.