I am working on a project where I use nodemon. Few days ago I installed and started nodemon. It was working but two hours later I had this error:
Error: Cannot find module 'node-sessionstorage'
Require stack:
- C:\Users\PC\Desktop\Ramses\Ramses\index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (C:\Users\PC\Desktop\Ramses\Ramses\index.js:35:17)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'C:\\Users\\PC\\Desktop\\Ramses\\Ramses\\index.js' ]
}
[nodemon] app crashed - waiting for file changes before starting...
After that I have not been able to make it work. What can I do? This is my package json:
{
"name": "ramses",
"version": "1.0.0",
"description": "Entorno de simulación...",
"main": "index.js",
"scripts": {
"start": "nodemon index.js"
},
"author": "PC",
"dependencies": {
"dom-to-image": "^2.6.0",
"express": "^4.17.3",
"express-load": "^1.1.16",
"express-session": "^1.17.2",
"html2canvas": "^1.4.1",
"mysql": "^2.18.1",
"nodemon": "^2.0.15"
}
}
And in my index.js I put this line to make nodemon work
const storage = require('node-sessionstorage');
the error is the node-sessionstorage is not present in your node_modules. also check your package.json file there is no node-sessionstorage as a dependencies so you need to run npm i node-sessionstorage and check the log carefully sometimes it happens there is error while installing packages so conclusion is package is not installed in your project install it and then it will work.