jamelo#2709
jamelo#27093mo ago

Hello, how do I use npm packages in buildship, how do I install them? For example, I need to use Pu

Hello, how do I use npm packages in buildship, how do I install them? For example, I need to use Puppertier
Solution:
Hi @jamelo#2709 To import any node library to BuildShip, Make sure to always import any packages using Named import declaration. Example: import module from "module-name"; & import Crypto from 'crypto'; The best way is to generate using AI https://www.youtube.com/watch?v=AawYfYW8xu0....
BuildShip
YouTube
Generating Custom Nodes with AI - BuildShip AI Workflow Builder
Get started with BuildShip for FREE 👉 https://buildship.com A Low-code Visual Backend Builder with AI 💬 Chat and build together with a community of no-code/low-code developers: https://buildship.com/discord 🐦 Tweets: https://twitter.com/buildshipapp #nocode #backend #apibuilder #lowcode #cronjob #scheduledtask #backgroundjob #googlecloud #ope...
Jump to solution
15 Replies
AI Support
AI Support3mo ago
To use npm packages like Puppeteer in BuildShip, you need to follow these steps: 1. Access the Workflow Editor: Open your workflow in the BuildShip editor. 2. Add a Code Node: Insert a Code Node where you want to use the npm package. 3. Install the npm Package: In the Code Node, you can specify the npm packages you need. For example, to install Puppeteer, you can include it in the dependencies section. Here is a general outline of the steps: 1. Add a Code Node: In your workflow, add a Code Node. 2. Specify Dependencies: In the Code Node, you can specify the dependencies you need. For example, to use Puppeteer, you can define it like this:
{
"dependencies": {
"puppeteer": "^10.0.0"
}
}
{
"dependencies": {
"puppeteer": "^10.0.0"
}
}
3. Use the Package: After specifying the dependencies, you can write your code using the npm package within the same Code Node. For detailed documentation, please refer to the BuildShip Documentation. If you have any further questions, please submit them via the in-app support button.
jamelo#2709
jamelo#27093mo ago
Sorry, but I couldn't find where to type the dependencies
AI Support
AI Support3mo ago
To add dependencies in BuildShip, you need to use the "Dependencies" section within your workflow setup. For specific instructions on how to manage dependencies, please refer to the BuildShip documentation. You can access the relevant documentation page here. If you cannot find the information you need, please submit your query via the in-app support button.
jamelo#2709
jamelo#27093mo ago
No description
AI Support
AI Support3mo ago
Sure, I'd be happy to assist! Could you please provide more details about your question related to BuildShip?
Solution
Gaurav Chadha
Gaurav Chadha3mo ago
Hi @jamelo#2709 To import any node library to BuildShip, Make sure to always import any packages using Named import declaration. Example: import module from "module-name"; & import Crypto from 'crypto'; The best way is to generate using AI https://www.youtube.com/watch?v=AawYfYW8xu0.
BuildShip
YouTube
Generating Custom Nodes with AI - BuildShip AI Workflow Builder
Get started with BuildShip for FREE 👉 https://buildship.com A Low-code Visual Backend Builder with AI 💬 Chat and build together with a community of no-code/low-code developers: https://buildship.com/discord 🐦 Tweets: https://twitter.com/buildshipapp #nocode #backend #apibuilder #lowcode #cronjob #scheduledtask #backgroundjob #googlecloud #ope...
robot007
robot0077d ago
@Gaurav Chadha @AI Support I have a similiar package installation question. I need "sharp" to convert a PNG file to a JPG file, and got the following error: I want to change image file format from PNG to JPG, and I got the following error message. Please help. Thanks a lot. ----------------------------------------- Could not load the "sharp" module using the linux-x64 runtime Possible solutions: - Ensure optional dependencies can be installed: npm install --include=optional sharp - Ensure your package manager supports multi-platform installation: See https://sharp.pixelplumbing.com/install#cross-platform - Add platform-specific dependencies: npm install --os=linux --cpu=x64 sharp - Consult the installation documentation: See https://sharp.pixelplumbing.com/install ----------------------------------- In the 'NPM packages' section, I see proper sharp package as shown in the attached image. It sees that installed package is not in the correct platform. How can I fix it. Thanks a lot
No description
AI Support
AI Support7d ago
AI Support Bot Information
<@1071499588390883328> you can react on the relevant answer (message) with a ✅ in this thread when you think it has been solved, by the bot or by a human! Anyone can react on this message with a ❌ if the GPT bot is unhelpful or hallucinating answers. Please note: Team members will review and answer the questions on best efforts basis.
robot007
robot0077d ago
@AI Support please explain the installation process where can I type in the commands, such as 'npm install --include=optional sharp'
Gaurav Chadha
Gaurav Chadha7d ago
Hey @robot007, you can install npm package using named import methods - import any npm package using Named import declaration. Example: import module from "module-name"; &import Crypto from 'crypto'; Best way is to generate with AI - https://docs.buildship.com/ai-nodes
AI Generated Nodes – BuildShip
A unified resource to start building your backend with low-code. Dive into triggers, nodes, and step-by-step guidance to jumpstart your workflow creation.
robot007
robot0077d ago
@Gaurav Chadha Dear Gaurav, thanks for your hint. I want to explain that I watched the video and search documentation before I asked question. I used BuildShip AI generated a node, and got the error I mentioned above. Could you provide more guidance. Thanks.
No description
robot007
robot0077d ago
No description
robot007
robot0077d ago
The above node was generated from this prompt:
No description
robot007
robot0075d ago
@Gaurav Chadha could you please give some hints? Thanks.
Gaurav Chadha
Gaurav Chadha4d ago
could you try using some other package? As this one requires additional dependency which is not supported to be imported in ES6 format eg: import name from package