question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nexe express4 Error: ENOENT, no such file or directory '\types\mime.types'

See original GitHub issue

seems there is a bug with nexe when including express4:

app.js

var express = require('express');
console.log('hello world');

package.json

{
  "name": "nexe_express_test",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "express": "~4.10.8"
  },
  "nexe": {
    "input": "./app.js",
    "output": "app.exe",
    "temp": "src",
    "runtime": {
        "framework": "nodejs",
        "version": "0.12.7",
        "ignoreFlags": true
    }
  }
}

i did npm install nexe -g once and now just call nexe, relying on the package.json config, passing no command line arguments

nexe runs without errors but running the output executable gives me this error:

C:\Users\filipecruz\Documents\nexe_express_test>app.exe
fs.js:500
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'C:\Users\filipecruz\Documents\nexe_exp
ress_test\types\mime.types'
    at Error (native)
    at Object.fs.openSync (fs.js:500:18)
    at Object.fs.readFileSync (fs.js:352:15)
    at Mime.load (nexe.js:20643:20)
    at Array.call.C:\Users\filipecruz\Documents\nexe_express_test\node_modules\e
xpress\node_modules\send\node_modules\mime\mime.js.path (nexe.js:20679:6)
    at initModule (nexe.js:29:11)
    at nexe.js:31:64
    at Array.call.C:\Users\filipecruz\Documents\nexe_express_test\node_modules\e
xpress\node_modules\send\index.js.stream (nexe.js:16516:12)
    at initModule (nexe.js:29:11)
    at nexe.js:31:64

removing the express lines in package.json and app.js prints hello world just fine.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
twmarrcommented, Sep 15, 2017

Will do in the A.M. since my brain has stopped working today. 😃

0reactions
calebboydcommented, Sep 15, 2017

Hmm Odd, Can you open a new issue with more information?

Closing this as express has been updated to have statically analyzable require statements

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - NodeJS NEXE bundle error - Stack Overflow
I was trying to use NEXE to bundle my express 4 project. ... Error: ENOENT, no such file or directory '..../release/types/mime.types'.
Read more >
Error: ENOENT: no such file or directory, scandir ... - YouTube
nodejsError: ENOENT : no such file or directory, scandir '**/node_modules/node-sass/vendor' | Module build failed (from .
Read more >
express error: enoent: no such file or directory, stat - You.com
To answer the question in the comments : In Express 4.x, the sendfile method was replaced by the sendFile method (all lowercase ->...
Read more >
mime-types - npm
The ultimate javascript content-type utility. Similar to the mime@1.x module, except: No fallbacks. Instead of naively returning the first ...
Read more >
tt - Energiepass-hst
Source. Installation. npm install --save @types/mime-types. ... L' Internet Assigned. nexe express4 Error: ENOENT, no such file or directory ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found