Import of @azure/msal-node in server folder not working

Hello all,

I’m currently facing an issue, where I can’t import the npm ‘msal-node’ package from the server folder.

Neither const msal = require('@azure/msal-node'); nor import {msal} from '@azure/msal-node' works when used in the main.js file in my server folder. When I import the package in a file within the client folder it works.

The package is in the node_modules folder and also listed in package.json. I installed it with npm install @azure/msal-node --save.

What am I doing wrong? I am fairly new to Meteor and web development in general, so any advice would be highly appreciated.

Thank you!

Which Meteor version are you using?
Do you have a reproduction repository where we can test it?

I am using Meteor 2.16. In the meantime I got it running with downgrading the msal-node version to 1.12.1.

To be honest, I don’t know why that works, what I could imagine is that it might be related to the fact that the msal-node version I used (2.9.1) is not supported for NodeJS 14 which is required for Meteor. But that is just guessing.

Sorry, I don’t have a repository for you to test it because it’s a corporate application.

If NodeJS 14 is not supported try using older version of the package that does, alternatively if you are starting up, just upgrade to the latest Meteor 3 RC and you should be fine with using that package as Meteor 3 uses Node 20.

Thank you for your answer, as mentioned using an older version of the package works. I think I will stick to Meteor 2 for now.