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:Jump to 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...
17 Replies
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:
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.Sorry, but I couldn't find where to type the dependencies
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.
Sure, I'd be happy to assist! Could you please provide more details about your question related to BuildShip?
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...
@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
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.
@AI Support please explain the installation process
where can I type in the commands, such as 'npm install --include=optional sharp'
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-nodesAI 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.
@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.
The above node was generated from this prompt:
@Gaurav Chadha could you please give some hints? Thanks.
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
@Gaurav Chadha Thanks. It seems the Jimp package works.
@Gaurav Chadha when i tried ai generate jimp node this error occures: {
"nodeId": "test-node-1727500902127",
"nodeName": "Resize and Change Image Quality",
"stage": "building node",
"errorObject": {
"errors": [
{
"id": "",
"location": {
"column": 7,
"file": "../../../tmp/test-node-1727500902127XXXXXXOisBbE/index.ts",
"length": 4,
"line": 1,
"lineText": "import Jimp from 'jimp';",
"namespace": "",
"suggestion": ""
},
"notes": [],
"pluginName": "",
"text": "No matching export in "../../../tmp/test-node-1727500902127XXXXXXOisBbE/node_modules/jimp/dist/esm/index.js" for import "default""
}
],
"warnings": []
}
}