跳至主要內容

Huly-palatform项目管理平台

程序员李某某大约 5 分钟

Huly-palatform项目管理平台

项目介绍

自托管部署

Docker

## 拉代码
git clone https://github.com/hcengineering/huly-selfhost.git
cd huly-selfhost
## 指定ip
setup.sh x.x.x.x
docker-compose up -f compose.yml

## 安装nginx略
## 在nginx.conf中添加 include /xxx/huly-selfhost/nginx.conf; xxx替换为自己的绝对路径
## 启动nginx
## 访问:x.x.x.x

源码构建

安装Node.js v20.11.0(版本必须是20),不要换淘宝源 安装docker、docker-compose 一键安装

git clone https://github.com/hcengineering/platform.git
cd platform
## 设置node-cache、node-global目录

sh ./scripts/fast-start.sh

看下执行的命令

## fast-start.sh
sh ./scripts/presetup-rush.sh
sh ./scripts/build.sh
sh ./scripts/create-workspace.sh


## presetup-rush.sh
npm install -g @microsoft/rush
rush install
rush build
## build.sh
cd ./dev/
# rush build    # 将构建所有必需的包。
# rush bundle   # 将准备捆绑包。
rush docker:build   # 构建 Docker 容器
rush docker:up # 启动容器
## create-workspace.sh
cd ./dev/tool
rushx run-local create-workspace ws1 -w DevWorkspace # 创建工作空间
rushx run-local create-account user1 -p 1234 -f John -l Appleseed # 创建用户
rushx run-local configure ws1 --list --enable '*' # 启用所有模块,即使它们尚未供广大受众使用。
rushx run-local assign-workspace user1 ws1 # 将工作区分配给用户。
rushx run-local confirm-email user1 # 允许创建其他测试工作区。

配置host(可省略)

vim /etc/hosts
127.0.0.1 host.docker.internal

访问 http://host.docker.internal:8087

执行rush install时报错

node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate: Running install script, failed in 939ms
.../node_modules/utf-8-validate install$ node-gyp-build
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@9.4.1
│ gyp info using node@20.11.0 | linux | x64
│ gyp ERR! find Python 
│ gyp ERR! find Python Python is not set from command line or npm configuration
│ gyp ERR! find Python Python is not set from environment variable PYTHON
│ gyp ERR! find Python checking if "python3" can be used
│ gyp ERR! find Python - "python3" is not in PATH or produced an error
│ gyp ERR! find Python checking if "python" can be used
│ gyp ERR! find Python - executable path is "/usr/bin/python"
│ gyp ERR! find Python - version is "2.7.5"
│ gyp ERR! find Python - version is 2.7.5 - should be >=3.6.0
│ gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
│ gyp ERR! find Python 
│ gyp ERR! find Python **********************************************************
│ gyp ERR! find Python You need to install the latest version of Python.
│ gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
│ gyp ERR! find Python you can try one of the following options:
│ gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
│ gyp ERR! find Python   (accepted by both node-gyp and npm)
│ gyp ERR! find Python - Set the environment variable PYTHON
│ gyp ERR! find Python - Set the npm configuration variable python:
│ gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
│ gyp ERR! find Python For more information consult the documentation at:
│ gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
│ gyp ERR! find Python **********************************************************
│ gyp ERR! find Python 
│ gyp ERR! configure error 
│ gyp ERR! stack Error: Could not find any Python installation to use
│ gyp ERR! stack     at PythonFinder.fail (/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/lib/find-python.js:330:47)
│ gyp ERR! stack     at PythonFinder.runChecks (/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/lib/find-python.js:159:21)
│ gyp ERR! stack     at PythonFinder.<anonymous> (/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/lib/find-python.js:266:16)
│ gyp ERR! stack     at PythonFinder.execFileCallback (/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/lib/find-python.js:297:7)
│ gyp ERR! stack     at ChildProcess.exithandler (node:child_process:414:7)
│ gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
│ gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
│ gyp ERR! System Linux 3.10.0-1160.el7.x86_64
│ gyp ERR! command "/data/node/bin/node" "/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
│ gyp ERR! cwd /data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate
│ gyp ERR! node -v v20.11.0
│ gyp ERR! node-gyp -v v9.4.1
│ gyp ERR! not ok 
└─ Failed in 939ms at /data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate
node_modules/.pnpm/puppeteer@22.14.0_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@6.0.4/node_modules/puppeteer: Running postinstall script...
node_modules/.pnpm/aws-sdk@2.1664.0/node_modules/aws-sdk: Running postinstall script, done in 250ms
 ELIFECYCLE  Command failed with exit code 1.

The command failed:
 /data/platform-develop/common/temp/pnpm-local/node_modules/.bin/pnpm install --store /data/platform-develop/common/temp/pnpm-store --config.cacheDir=/data/platform-develop/common/temp/pnpm-store --config.stateDir=/data/platform-develop/common/temp/pnpm-store --no-prefer-frozen-lockfile --no-strict-peer-dependencies --config.auto-install-peers=false --config.resolutionMode=highest --config.ignoreCompatibilityDb
ERROR: Error: Process exited with code 1
Giving up after 1 attempts

安装Python3

报错

node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate: Running install script, failed in 24s
.../node_modules/utf-8-validate install$ node-gyp-build
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@9.4.1
│ gyp info using node@20.11.0 | linux | x64
│ gyp info find Python using Python version 3.6.8 found at "/usr/bin/python3"
│ gyp http GET https://unofficial-builds.nodejs.org/download/release/v20.11.0/node-v20.11.0-headers.tar.gz
│ gyp http 200 https://unofficial-builds.nodejs.org/download/release/v20.11.0/node-v20.11.0-headers.tar.gz
│ gyp http GET https://unofficial-builds.nodejs.org/download/release/v20.11.0/SHASUMS256.txt
│ gyp http 200 https://unofficial-builds.nodejs.org/download/release/v20.11.0/SHASUMS256.txt
│ gyp info spawn /usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args   '/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/gyp/gyp_main.py',
│ gyp info spawn args   'binding.gyp',
│ gyp info spawn args   '-f',
│ gyp info spawn args   'make',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate/build/config.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args   '-I',
│ gyp info spawn args   '/root/.cache/node-gyp/20.11.0/include/node/common.gypi',
│ gyp info spawn args   '-Dlibrary=shared_library',
│ gyp info spawn args   '-Dvisibility=default',
│ gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/20.11.0',
│ gyp info spawn args   '-Dnode_gyp_dir=/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp',
│ gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/20.11.0/<(target_arch)/node.lib',
│ gyp info spawn args   '-Dmodule_root_dir=/data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate',
│ gyp info spawn args   '-Dnode_engine=v8',
│ gyp info spawn args   '--depth=.',
│ gyp info spawn args   '--no-parallel',
│ gyp info spawn args   '--generator-output',
│ gyp info spawn args   'build',
│ gyp info spawn args   '-Goutput_dir=.'
│ gyp info spawn args ]
│ gyp info spawn make
│ gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
│ make: 进入目录“/data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate/build”
│   CXX(target) Release/obj.target/validation/src/validation.o
│ make: g++:命令未找到
│ make: *** [Release/obj.target/validation/src/validation.o] 错误 127
│ make: 离开目录“/data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate/build”
│ gyp ERR! build error 
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack     at ChildProcess.onExit (/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/lib/build.js:203:23)
│ gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
│ gyp ERR! System Linux 3.10.0-1160.el7.x86_64
│ gyp ERR! command "/data/node/bin/node" "/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
│ gyp ERR! cwd /data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate
│ gyp ERR! node -v v20.11.0
│ gyp ERR! node-gyp -v v9.4.1
│ gyp ERR! not ok 
└─ Failed in 24s at /data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate
node_modules/.pnpm/puppeteer@22.14.0_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@6.0.4/node_modules/puppeteer: Running postinstall script...
node_modules/.pnpm/aws-sdk@2.1664.0/node_modules/aws-sdk: Running postinstall script, done in 170ms
 ELIFECYCLE  Command failed with exit code 1.

The command failed:
 /data/platform-develop/common/temp/pnpm-local/node_modules/.bin/pnpm install --store /data/platform-develop/common/temp/pnpm-store --config.cacheDir=/data/platform-develop/common/temp/pnpm-store --config.stateDir=/data/platform-develop/common/temp/pnpm-store --no-prefer-frozen-lockfile --no-strict-peer-dependencies --config.auto-install-peers=false --config.resolutionMode=highest --config.ignoreCompatibilityDb
ERROR: Error: Process exited with code 1
Giving up after 1 attempts

安装g++

## Ubuntu 或 Debian 系统上,可以使用以下命令安装 g++:
sudo apt update
sudo apt install g++
## Fedora 系统上,可以使用:
sudo dnf install gcc-c++
## CentOS 或 RHEL 系统上,可以使用:
sudo yum install gcc-c++
## 在 macOS,可以通过 Homebrew 安装:
brew install gcc

还报错

│ g++: 错误:unrecognized command line option ‘-std=gnu++17’
│ make: *** [Release/obj.target/validation/src/validation.o] 错误 1
│ make: 离开目录“/data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate/build”
│ gyp ERR! build error 
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack     at ChildProcess.onExit (/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/lib/build.js:203:23)
│ gyp ERR! stack     at ChildProcess.emit (node:events:518:28)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
│ gyp ERR! System Linux 3.10.0-1160.el7.x86_64
│ gyp ERR! command "/data/node/bin/node" "/data/platform-develop/common/temp/node_modules/.pnpm/node-gyp@9.4.1/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
│ gyp ERR! cwd /data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate
│ gyp ERR! node -v v20.11.0
│ gyp ERR! node-gyp -v v9.4.1
│ gyp ERR! not ok 
└─ Failed in 1.3s at /data/platform-develop/common/temp/node_modules/.pnpm/utf-8-validate@6.0.4/node_modules/utf-8-validate
node_modules/.pnpm/puppeteer@22.14.0_bufferutil@4.0.8_typescript@5.3.3_utf-8-validate@6.0.4/node_modules/puppeteer: Running postinstall script...
 ELIFECYCLE  Command failed with exit code 1.

升级gcc

## 在 Ubuntu 上升级到 GCC 5
# 添加工具链 PPA(个人包档案):
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
# 安装 GCC 5
sudo apt-get install gcc-5 g++-5
# 更新替代项(使系统使用 GCC 5):
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
gcc --version
## CentOS 上升级到 GCC 5
# 启用软件集合(SCL)库:
sudo yum install centos-release-scl
# 安装 GCC 5
sudo yum install devtoolset-5-gcc devtoolset-5-gcc-c++
# 启用开发工具集
scl enable devtoolset-5 bash
gcc --version
上次编辑于:
贡献者: liyuanhao