Open valtlfelipe opened 7 years ago
Similar problem. We use Node 8 but instead we get a runtime error.
ERROR TypeError: mime.lookup is not a function
at /app/node_modules/knox/lib/client.js:363:28
at FSReqWrap.oncomplete (fs.js:153:5)
I have the same problem that @valtlfelipe
Same issue. Old 0.12.7 server got re-initialised this morning.
Thanks @valtlfelipe & @neebz
You can temporarily use their fixed version of 0.9.2 by using:
"knox": "git://github.com/caremerge/knox.git#b1e031c209b3c17cab622a458e87728c1ee88cbd",
In your package.json
It seems this package is no longer maintained.
I have created a clone with the fix here: https://www.npmjs.com/package/knox-s3
No other changes other than pinning the mime
version.
So there's no chance of getting this fixed? I'm not using Knox directly, I'm actually using Keystone, which has Knox as a dependency itself, so I keep getting this mime.lookup error. Any suggestions if this won't get fixed?
@manuelxaguilar You will have to open an issue at Keystone, so they can change the konx
dependency to use @dwjft fork for example :disappointed:
@manuelxaguilar @valtlfelipe You can also investigate npm shrinkwrap
to prevent this sort of thing in the future.
@valtlfelipe Yeah, I brought it up but they seem to take forever to reply... We'll see I guess.
@sedge I'm using Yarn on my project, which I believe doesn't work well with npm-shrinkwrap. I actually used resolutions
to determine which version of Knox to use (I used @PyroSA fork) and it worked well on development, however it failed when deploying to Heroku because it wasn't recognizing git as a valid protocol. :/
If you use yarn
you can get around this issue by using https://yarnpkg.com/lang/en/docs/selective-version-resolutions/
// package.json { .... "resolutions": { "keystone/knox/mime": "1.4.0" } }
Thanks @madsleejensen - that worked for me, though I was using knox
via the s3-sync
package, so my `"resolutions" looked like this:
"resolutions": { "s3-sync/knox/mime": "1.4.0" }
The key idea being, one needs to specify the path to mime
via the packages they're using. (You can run yarn why mime
to find yours.
node-mime has released a new version, which requires node>=6. And in package.json of knox requires mim in any version
"mime": "*",
.My enviorment uses node 4, and this just broke my application.
Please merge https://github.com/Automattic/knox/pull/325.
See the stack trace.