Jump to content

Hello, 

 

I am currently learning MERN stack software development, and I keep having an issue with running my express server on my pc with nodemon. I keep getting an error something like: 

 invalid ELF header code:....'ERR_DLOPEN_FAILED'....at Object.<anonymous>.... node_modules/bcrypt/bcrypt.js:6:16)

And before this happened it would run. But I noticed that the proxy in package.json was different than the port I listed in my server file. I changed it, and now it won't run. Furthermore, when the server was running, I would keep getting a 404 error. How do I fix this?

 

Oh and for background information, I am using WSL on windows 11. I don't know if that makes a difference

 

I made a fuller post on stack overflow if that helps https://stackoverflow.com/questions/75430370/wsl-unable-to-run-express-server-while-developing-a-mern-stack-app

 

Link to comment
https://linustechtips.com/topic/1487977-trouble-running-local-express-server/
Share on other sites

Link to post
Share on other sites

18 minutes ago, MacMang98 said:

I made a fuller post on stack overflow if that helps https://stackoverflow.com/questions/75339372/error-while-trying-to-run-npx-create-react-app-in-wsl

 

'\\wsl.localhost\Ubuntu-22.04\home\pat\sei\testing'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
node:fs:1395
  handleErrorFromBinding(ctx);
  ^

Error: EPERM: operation not permitted, mkdir 'my-app'
    at Object.mkdirSync (node:fs:1395:3)
    at module.exports.makeDirSync (C:\Users\Patrick\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\fs-extra\lib\mkdirs\make-dir.js:23:13)
    at createApp (C:\Users\Patrick\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:257:6)
    at C:\Users\Patrick\AppData\Local\npm-cache\_npx\c67e74de0542c87c\node_modules\create-react-app\createReactApp.js:223:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -4048,
  syscall: 'mkdir',
  code: 'EPERM',
  path: 'my-app'
}

Node.js v18.12.1

 

I am confused by this error message?  The Unc error message to me implies you have installed node locally in Windows and then opening a windows command prompt at the location of your wsl home directory to run the npx create-react-app command.

The problem with this is this the command needs to be ran from an active wsl environment/session. There should not be any windows file path references from an error message coming from an active wsl session.  They should be linux style file paths

 

With an active wsl session the command prompt should start like this

user@hostname:~$

Not as

C:\Users\user>

 

Link to post
Share on other sites

53 minutes ago, C2dan88 said:

I am confused by this error message?  The Unc error message to me implies you have installed node locally in Windows and then opening a windows command prompt at the location of your wsl home directory to run the npx create-react-app command.

The problem with this is this the command needs to be ran from an active wsl environment/session. There should not be any windows file path references from an error message coming from an active wsl session.  They should be linux style file paths

 

With an active wsl session the command prompt should start like this

user@hostname:~$

Not as

C:\Users\user>

 

My apologies. I grabbed the wrong link for stack overflow. That issue I have sorted out. this is the actual issue https://stackoverflow.com/questions/75430370/wsl-unable-to-run-express-server-while-developing-a-mern-stack-app. It has something to do with bcyrpt I think. As it is pointing to an error in my node_modules 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×