I am trying to get Express and Multer Node.js packages to work with Meteor 1.7, but I am ending up with error messages.
I followed this tutorial https://themeteorchef.com/tutorials/using-npm-packages and took the following steps to install Express and Multer packages:
created a new meteor project
ran meteor npm install express multer --save
command
imported the two packages to the app via api.js file (imported to both server and client during dev), which reads:
import { Meteor } from 'meteor/meteor'; import multer from 'multer'; import express from 'express'; const app = express(); app.use(function (req, res, next) { console.log('Time:', Date.now()) next() });
In the system console, I get the following error:
TypeError: express is not a function
and Meteor exits with:
code 1 ==> Your application is crashing. Waiting for file change.
What am I doing wrong?
Unsure if you can use express with meteor. Meteor has a built in WebApp module which you can use to add custom routing if that is what you are trying to do
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.