Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with mime #33

Closed
HenkATwaag opened this issue Feb 8, 2018 · 2 comments
Closed

issue with mime #33

HenkATwaag opened this issue Feb 8, 2018 · 2 comments

Comments

@HenkATwaag
Copy link

having issues with mime

Ubuntu Bionic Beaver
node --version v8.9.4

Solved by replacing mime to mime-types in node_modules/node-static/lib/node-static.js
line 7,
< , mime = require('mime')

, mime = require('mime-types')

npm install mime-types

=========================================================================
npm start

fabmodules-html5@1.0.0 start /home/henk/fabacademy/programs/fabmodules-html5
PATH=./mod_server/:$PATH node ./mod_server/mod_server.js

listening for connections from 127.0.0.1 on 12345
/home/henk/fabacademy/programs/fabmodules-html5/node_modules/node-static/lib/node-static.js:348
mime.lookup(files[0]) ||
^

TypeError: mime.lookup is not a function
at Server.respond (/home/henk/fabacademy/programs/fabmodules-html5/node_modules/node-static/lib/node-static.js:348:28)
at /home/henk/fabacademy/programs/fabmodules-html5/node_modules/node-static/lib/node-static.js:146:22
at FSReqWrap.oncomplete (fs.js:153:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fabmodules-html5@1.0.0 start: PATH=./mod_server/:$PATH node ./mod_server/mod_server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fabmodules-html5@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

==============================================================================

@ludusrusso
Copy link
Contributor

Hi, I've got the exact same error. I've solved with this command:

npm install mime@1.3.6

Hope it helps :D

@rahji
Copy link

rahji commented Jun 8, 2018

I was able to fix this problem by editing fabmodules-html5/node_modules/node-static/lib/node-static.js

I replaced the call to mime.lookup with mime.getType and I no longer get this error.

fibasile added a commit that referenced this issue Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants