Prerequisites
Before installing P2P File Share, ensure you have the following:Node.js v22 or higher
This project requires Node.js version 22 or later. Check your version with
node --version.The project has no external npm dependencies - it uses only Node.js built-in modules like
net, fs, and crypto.Installation Steps
Verify Node.js version
First, confirm you have Node.js v22 or higher installed:You should see output like
v22.0.0 or higher. If you need to install or upgrade Node.js, visit nodejs.org.Clone the repository
Clone the P2P File Share repository to your local machine:Replace
<repository-url> with the actual repository URL.Verify the installation
Since the project has no external dependencies, you can verify the installation by checking the project structure:You should see three JavaScript files:
manager.js- File management and hash calculationnode.js- P2P networking logicpeer.js- Application entry point
Alternative: Using npm Scripts
Thepackage.json file includes convenient npm scripts for common operations:
package.json
Firewall Configuration
Since P2P File Share uses TCP connections, you may need to configure your firewall:Allow incoming TCP connections
Ensure your firewall allows incoming TCP connections on the port you specify with
--port. For example, if using port 6881:Linux (iptables)
macOS (built-in firewall)
System Requirements
| Requirement | Specification |
|---|---|
| Node.js | v22.0.0 or higher |
| Operating System | Linux, macOS, or Windows |
| Network | TCP connectivity between peers |
| Disk Space | Sufficient space for files being shared |
| Dependencies | None (uses Node.js built-in modules only) |
Troubleshooting
Node version too old
Node version too old
If you see errors about unsupported features, your Node.js version may be too old. Update to v22 or higher:
Port already in use
Port already in use
If you see
EADDRINUSE errors, another application is using the port. Choose a different port number with the --port flag:Cannot connect to peer
Cannot connect to peer
If you cannot connect to a peer:
- Verify the peer is running and listening on the specified port
- Check firewall settings on both machines
- Ensure the host and port in
--peerare correct - Verify network connectivity with
pingortelnet