Skip to content

Support Installing ECharts (JavaScript) in Code Execution Node for Docker Local Deployment (1.10.1->fix.1) #234

Description

@zlove520

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Description
I am using Dify 1.10.1->fix.1 deployed locally via Docker Compose. I need to use the Code Execution node to run JavaScript code and generate charts with the ECharts library, but I cannot find a valid way to install the ECharts npm package in the Dockerized code-executor environment.
I have tried:
Installing ECharts directly via npm install echarts in the Code Execution node (fails, no persistent installation)
Modifying the docker-compose.yml and code-executor Dockerfile to add npm installation commands (no effect, container rebuilds do not persist dependencies)
Checking official documentation and community issues (no clear guide for JS library installation in Docker deployment)
Core Requirement
I need an official, reliable solution to:
Install the ECharts (JavaScript) npm package globally/persistently in the Dify code-executor container
Use const echarts = require('echarts') normally in the Code Execution node to generate charts
Ensure the installation persists after docker compose down && docker compose up -d

2. Additional context or comments

Could you please provide:
Step-by-step commands to install ECharts for the code-executor service in Docker local deployment
Official recommended configuration (Dockerfile / docker-compose.yml / volume mounts) for persistent npm package installation
A minimal working JavaScript code example for ECharts in the Code Execution node
This will help many users who need to use visualization libraries (ECharts, Chart.js, etc.) in Dify's code execution feature.
Thank you very much for your support!

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions