1

When I run my Node.js application I always get Error: Can't resolve 'fs'. I looked into some questions and tried to change the dependencies in my package.json file.

"dependencies": {
  "@types/vexflow": "^3.0.0",
  "fs": "^0.0.1-security",
  "jszip": "3.7.1",
  "loglevel": "^1.6.8",
  "socket.io": "^4.2.0",
  "typescript-collections": "^1.3.3",
  "vexflow": "1.2.93"
},

Is there something else I need to do?

Thanks

Goggi
  • 32
  • 8
  • 1
    fs is a core node module, why do you need to install it? – Naeem Sep 30 '21 at 13:39
  • I want the error to go away. I installed everything properly so I don't know why it can't resolve the module – Goggi Sep 30 '21 at 13:40
  • can you show the complete error? – Naeem Sep 30 '21 at 13:41
  • ERROR in ./node_modules/destroy/index.js Module not found: Error: Can't resolve 'fs' in 'C:\Users\Florian Gogg\Documents\HTL Kaindorf\4.Klasse\SYP\KW\Project\DiSMR\node_modules\destroy' @ ./node_modules/destroy/index.js 13:17-30 @ ./node_modules/send/index.js @ ./node_modules/express/lib/response.js @ ./node_modules/express/lib/express.js @ ./node_modules/express/index.js @ ./demo/index.js – Goggi Sep 30 '21 at 13:42
  • The same error occours in some other index.js files in other directories too – Goggi Sep 30 '21 at 13:42
  • https://stackoverflow.com/questions/57161839/module-not-found-error-cant-resolve-fs-in – Naeem Sep 30 '21 at 13:47
  • I already tried the things that were suggested in this question but that does not work either – Goggi Sep 30 '21 at 13:50
  • did you try by uninstalling fs? – Naeem Sep 30 '21 at 13:51
  • yes I did, and then reinstalled it but get the same error again – Goggi Sep 30 '21 at 14:00
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/237670/discussion-between-goggi-and-naeem). – Goggi Sep 30 '21 at 14:03

0 Answers0