Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
46
rated 0 times [  53] [ 7]  / answers: 1 / hits: 5699  / 2 Years ago, wed, january 19, 2022, 12:00:00

So, something happened a couple of days ago and a project of mine started showing the following error:


TypeError: Busboy is not a constructor
at /app/node_modules/connect-busboy/index.js:21:18
at /app/node_modules/express-fileupload/lib/index.js:9:31
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:323:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:341:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at urlencodedParser (/app/node_modules/body-parser/lib/types/urlencoded.js:100:7)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:323:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:341:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at jsonParser (/app/node_modules/body-parser/lib/types/json.js:119:7)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:323:13)
at /app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/app/node_modules/express/lib/router/index.js:341:12)
at next (/app/node_modules/express/lib/router/index.js:275:10)
at logger (/app/node_modules/morgan/index.js:144:5)
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:323:13)

What I think is strange is that this Busboy isn't being used on my code, only in dependencies from node_modules. Does anyone know if there is any compatibility error with the version of Busboy or any of those listed in the error that could cause such thing?


More From » node.js

 Answers
5

Look, node_modules doesn't only contain the packages, which you installed, it also contains dependencies of your installed packages. So a good practice is to use lock files as package-lock.json, which will lock every package's version and every time you run npm install it installs the exact locked versions (to be more precise - with npm ci script). So in this case as I see one of your packages has been updated or maybe that "busboy" package has been updated and after you ran install script it brought to you the updated package (or packages) which involves this error.


[#465] Friday, January 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
isham

Total Points: 69
Total Questions: 86
Total Answers: 86

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
;