NPM
Install DataKit using npm.
Quick Start
npm install -g datakit-cli && datakit
Prerequisites
- Node.js 14 or higher
- npm package manager
Check Node.js Version
node --version
npm --version
Install Node.js (if needed)
Download from nodejs.org or use package managers:
# macOS
brew install node
# Ubuntu/Debian
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
Installation Options
Global Installation (recommended)
npm install -g datakit-cli
Using Yarn
yarn global add datakit-cli
Run without Installing
npx datakit-cli
Usage Commands
# Start DataKit
datakit
# Start without opening browser
datakit serve --no-open
# Start on custom port
datakit serve --port 8080
# Show system info
datakit info
# Check version
datakit --version
Integration with Development
Add to your package.json
scripts:
{
"scripts": {
"data": "datakit",
"analyze": "datakit serve --no-open"
}
}
Then run:
npm run data
Management
# Update DataKit
datakit update
# Uninstall
npm uninstall -g datakit-cli
Troubleshooting
Permission errors (macOS/Linux):
# Fix npm permissions
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Command not found:
# Check global bin directory
npm config get prefix
# Add to PATH
export PATH="$(npm config get prefix)/bin:$PATH"