If you want to contribute to Luban, you can follow the instructions below to set up the development environment.
-
Update software sources.
> sudo apt update -
Install
Git.> sudo apt install git -
Install Node.js 12. You can use NVM (Node Version Manager) to install and manage multiple Node.js versions:
> nvm install 12 > nvm use 12
-
Install dependencies for Linux builds and compilation environment for third-party dependencies.
> sudo apt install rpm > sudo apt install make g++ libfontconfig-dev
-
Update software sources.
> sudo yum update -
Install
Git.> sudo yum install git -
Install Node.js 12. You can use NVM (Node Version Manager) to install and manage multiple Node.js versions:
> nvm install 12 > nvm use 12
-
Install dependencies for Linux builds and compilation environment for third-party dependencies.
> sudo yum install rpm-build > sudo yum install make gcc-c++ freetype-devel fontconfig-devel
- Install
Gitfrom https://git-scm.com/. - Install Node.js 12 from https://nodejs.org/dist/latest-v12.x/.
- Install node-gyp compilation environment for the third-party denpendencies.
-
Official: You can follow node-gyp installation instructions.
-
Alternative: Open
Git Bashas administrator and follow the steps below. This will take about half an hour.> npm install -g windows-build-tools > npm config set msvs_version 2017
or
> npm config set @xiekun1992:registry=https://npm.pkg.github.com/ > npm config set //npm.pkg.github.com/:_authToken=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 > npm install -g @xiekun1992/windows-build-tools@5.2.3 > npm config set msvs_version 2017
Note: By now the latest version of
windows-build-toolsis v5.2.2, which has an issue of Visual Studio Build Tools in endless wait loop. In order to save your time, we fixed the bug and provide the second way.
-
-
Clone this repository.
> git clone https://github.com/Snapmaker/Luban.git > cd Luban
-
Use
npmto install package dependencies:> npm install -
Start dev server locally:
> npm run dev -
Open browser (recommend Chrome) and navigate to http://localhost:8000.
-
For developers in China, you can use taobao mirror.
> npm config set registry https://registry.npm.taobao.org/ > ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/" npm install
-
Q: Encounter a
RequestErrorwhen installing electron?A: Check your system proxy and try
rm -rf node_modules/electron && npm installagain. -
Q: Develop in Firefox encounters an blank screen?
A: There is a compatible problem of
getScreenCTM()in using SVG in Firefox, switch to Chrome.