mermaid-rendering / install.sh
liaoch's picture
Fix: ensure tesseract-ocr is installed and npm global bin is in PATH for correct mmdc version
66c4c74
raw
history blame contribute delete
759 Bytes
#!/bin/bash
set -e
# Install nvm (Node Version Manager)
export NVM_DIR="$HOME/.nvm"
if [ ! -d "$NVM_DIR" ]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
fi
# Load nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# Install Node.js v24 (latest LTS as of June 2025)
nvm install 24
nvm use 24
nvm alias default 24
# Ensure npm is up to date
npm install -g npm
# Install the latest mmdc (e.g., 11.4.2)
npm install -g @mermaid-js/[email protected]
# Ensure npm global bin is in PATH for all processes
export PATH="$(npm bin -g):$PATH"
# Print versions for debugging
echo "Node.js version: $(node --version)"
echo "npm version: $(npm --version)"
echo "mmdc version: $(mmdc --version)"