keyboard-mouse-share
Version:
Share keyboard and mouse between Mac and Windows
173 lines (127 loc) • 2.82 kB
Markdown
# Installation Guide
## Quick Installation (Recommended)
### From Source
```bash
cd kms-node
npm install
npm link
```
Now you can use the `kms` command globally!
## Verify Installation
```bash
kms --version
# Should output: 0.1.0
kms --help
# Should show all available commands
```
## Platform-Specific Instructions
### macOS (like your setup)
**Prerequisites:**
- Node.js v16+ (you have v22.12.0 ✅)
- Terminal with Accessibility permissions
**Steps:**
1. **Grant Accessibility Permissions:**
```
System Preferences → Security & Privacy → Privacy → Accessibility
→ Click the lock to make changes
→ Click "+" and add your Terminal app
```
2. **Install:**
```bash
cd kms-node
npm install
npm link
```
3. **Test:**
```bash
kms --version
```
**That's it!** No build tools needed. nut.js provides pre-built binaries for macOS.
### Windows
**Prerequisites:**
- Node.js v16+
- Administrator privileges
**Steps:**
1. Open PowerShell or CMD **as Administrator**
2. Install:
```bash
cd kms-node
npm install
npm link
```
3. Test:
```bash
kms --version
```
### Linux (Ubuntu/Debian)
**Prerequisites:**
- Node.js v16+
- X11 development libraries
**Steps:**
1. Install dependencies:
```bash
sudo apt-get update
sudo apt-get install libxtst-dev libpng++-dev
```
2. Install KMS:
```bash
cd kms-node
npm install
npm link
```
3. Test:
```bash
kms --version
```
## Troubleshooting
### "npm: command not found"
Install Node.js and npm:
- macOS: `brew install node` or download from https://nodejs.org
- Windows: Download from https://nodejs.org
- Linux: `sudo apt-get install nodejs npm`
### "Permission denied" on npm link
Use sudo (Linux/Mac):
```bash
sudo npm link
```
Or fix npm permissions:
```bash
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile
source ~/.profile
```
### "@nut-tree/nut-js installation failed"
**On macOS:**
- Usually works out of the box with pre-built binaries
- If fails, ensure you're on Node.js v16+
**On Windows:**
- Run terminal as Administrator
- Pre-built binaries should work
**On Linux:**
- Install X11 libraries: `sudo apt-get install libxtst-dev libpng++-dev`
### "Cannot find module '@nut-tree/nut-js'"
Run `npm install` again:
```bash
cd kms-node
npm install
```
## Uninstallation
```bash
npm unlink -g keyboard-mouse-share
cd kms-node
npm uninstall
```
## Next Steps
After installation, check out:
- [README.md](./README.md) - Full documentation
- [NPM_PUBLISH.md](./NPM_PUBLISH.md) - Publishing guide
Start using KMS:
```bash
# On server machine
kms init --mode server --port 5555
kms start
# On client machine
kms init --mode client --host <server-ip> --port 5555
kms start
```