joysterling
joysterling

Reputation: 1

(Node.JS) NodeRequire does not succeed/find module when launching Microsoft Edge Instance

For starters, I am a complete novice when it comes to web development, so I apologize first for likely lacking appropriate information. Any discussion will be helpful so I can get a better idea of how Node.JS and live-server work.

I am attempting to debug a app.js file I wrote, with the following steps:

  1. In VSCode; deploying to live-server localhost, port 5500.
  2. Launching Microsoft Edge on localhost, port 5500.

I can successfully hit my breakpoints in the (app).js file, provided below (as one line). On Edge, it exits unsuccessfully on this line:

var express = require('express');

Unfortunately, I can't seem to get more information on what's causing the failure. Some additional information of my own:

  1. I did npm install express and can find the express folder in my node_modules, but when hovering over the require function, I see a different path to my Local AppData folder. I also tried require('../node_modules/express/index') directly, but that also exited unsuccessfully.
  2. The file does run succesfully if I call it directly with node app.js, which confuses me what the difference between this function and what Edge does.

I'm sure there's something I neglected to mention, so please let me know!

I tried using NodeRequire in Node.JS while launching to Microsoft Edge. I was expecting this to work like when I called it directly with node app.js, but it instead exited unsuccessfully.

Upvotes: 0

Views: 288

Answers (0)

Related Questions