module.js:491 throw err; Ошибка: не удается найти модуль "www/node-str/index.js"

Я с этой проблемой, и я не могу решить, насколько я понял, я не нашел никаких ошибок, но я новичок, поэтому я не знаю много, вот код:

[nodemon] starting `node index.js`
module.js:491
throw err;
^

Error: Cannot find module '/www/node-str/index.js'
at Function.Module._resolveFilename (module.js:489:15) 
at Function.Module._load (module.js:439:25)
at Function.Module.runMain (module.js:609:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:598:3
[nodemon] app crashed - waiting for file changes before starting...

app.js

 const express = require('express');
 const bodyParser = require('body-parser');

 const app = express();
 const router = express.Router();


 const index = require('./routes/index');
 const products = require('./routes/products')

 app.use(bodyParser.json());
 app.use(bodyParser.urlencoded({ extended: false}));

 app.use('/', index);
 app.use('/products', products);

 module.exports = app;

index.js

 'use strict';

 const express = require('express');
 const router = express.Router();

 router.get('/', (req, res, next) => {
 res.status(200).send({ title: "Node Store API", version: "0.0.1" });
 });

 module.exports = router;

каталог

1 ответ

Ваш package.json это:

"main": "src/app.js"

Другие вопросы по тегам