Skip to Content
0
Jan 30, 2023 at 08:37 PM

Using node.js module in Business Application Studio

383 Views

Hi,

I am trying to use a node.js module (jsftp) in my BAS Project that did not come in on the template generator. I have added it via the terminal with this command: npm install jsftp --save-dev This ends up adding it to the package.json devDependencies section:

image.png

I can also see the folder in the project's node_modules folder, and everything seems fine.

image.png

Now, when I'm in my controller code, I would expect to be able to use this library. I've tried putting it in the sap.ui.define list at the start of the controller. I've tried that with "jsftp", "../node_modules/jsftp", etc but it does not work.

image.png

When I load the page, it errors with a 404-NotFound message of

image.png

This happens in various forms no matter what I put in the define section. The same thing happens is I do jQuery.sap.require("jsftp"). I've run npm install and that also does not seem to help anything.

I just can't find a way to utilize in my controller module a library that is added via an node.js module. I apologize for what seems like it should be a simple question, but I've been looking for the answer for several days and can not find anything that works.

Thanks,

Jeff

Attachments

image.png (29.5 kB)
image.png (6.3 kB)
image.png (18.0 kB)
image.png (28.5 kB)