Halin源码编译安装运行

 

Here’s the table of contents:

  1. 下载安装nodejs
  2. 源码编译运行Halin
  3. 修改Yarn源
  4. 修改npm源
  5. 部分镜像源地址如下
  6. 使用Yarn安装本地包
  7. CentOS安装Yarn和Nodejs
  8. Halin源码地址
  9. Yarn Install报错解决
  10. Yarn Install –Force报错解决
  11. Navigate页面访问报错解决

下载安装nodejs

https://nodejs.org/dist/v14.15.1/node-v14.15.1-x64.msi
sudo wget https://nodejs.org/dist/v14.15.1/node-v14.15.1-linux-x64.tar.gz
sudo tar -zxvf node-v14.15.1-linux-x64.tar.gz
sudo ln -s /usr/local/node/node-v14.15.1-linux-x64/bin/npm /usr/local/bin/npm
sudo ln -s /usr/local/node/node-v14.15.1-linux-x64/bin/node /usr/local/bin/node
sudo ln -s /usr/local/node/node-v14.15.1-linux-x64/bin/npm /usr/bin/npm
sudo ln -s /usr/local/node/node-v14.15.1-linux-x64/bin/node /usr/bin/node
npm -v
node -v
sudo ln -s /usr/local/node/node-v14.15.1-linux-x64/bin/webpack /usr/local/bin/webpack
sudo ln -s /usr/local/node/node-v14.15.1-linux-x64/bin/webpack-cli /usr/local/bin/webpack-cli
sudo ln -s /usr/local/node/node-v14.15.1-linux-x64/bin/webpack-dev-server /usr/local/bin/webpack-dev-server
webpack -v
webpack-cli -v

源码编译运行Halin

PS E:\workspace\ongdb\halin> cmd
Microsoft Windows [版本 10.0.18362.30]
(c) 2019 Microsoft Corporation。保留所有权利。
E:\workspace\ongdb\halin>npm
Usage: npm <command>
where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, fund, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami
npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview
Specify configs in the ini-formatted file:
    C:\Users\mayc01\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@6.14.8 C:\Program Files\nodejs\node_modules\npm
E:\workspace\ongdb\halin>npm install -g yarn
> yarn@1.22.10 preinstall C:\Users\mayc01\AppData\Roaming\npm\node_modules\yarn
> :; (node ./preinstall.js > /dev/null 2>&1 || true)
C:\Users\mayc01\AppData\Roaming\npm\yarn -> C:\Users\mayc01\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
C:\Users\mayc01\AppData\Roaming\npm\yarnpkg -> C:\Users\mayc01\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
+ yarn@1.22.10
added 1 package in 0.786s
E:\workspace\ongdb\halin>yarn install
错误: 找不到或无法加载主类 install
E:\workspace\ongdb\halin>C:\Users\mayc01\AppData\Roaming\npm\yarn install

修改Yarn源

  • 查看源
    C:\Users\mayc01\AppData\Roaming\npm\yarn config get registry
    
  • 设置yarn镜像源为淘宝镜像
    C:\Users\mayc01\AppData\Roaming\npm\yarn config set registry https://registry.npm.taobao.org/
    

修改npm源

  • 查看源
    npm config get registry
    
  • 设置npm镜像源为淘宝镜像
    npm config set registry https://registry.npm.taobao.org/
    

部分镜像源地址如下

npm --- https://registry.npmjs.org/
cnpm --- https://r.cnpmjs.org/
taobao --- https://registry.npm.taobao.org/
nj --- https://registry.nodejitsu.com/
rednpm --- https://registry.mirror.cqupt.edu.cn/
npmMirror --- https://skimdb.npmjs.com/registry/
deunpm --- http://registry.enpmjs.org/

使用Yarn安装本地包

yarn add file:

CentOS安装Yarn和Nodejs

sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
sudo yum install yarn
yarn --version

Halin源码地址

  • Clone the repo
  • yarn install
  • yarn start 【启动服务】
  • Navigate to http://localhost:3000/
    https://github.com/ongdb-contrib/halin
    

Yarn Install报错解决

error vis-util@1.1.10: The engine "node" is incompatible with this module. Expected version ">=8". Got "6.17.1" error Found incompatible module
  • 修改参数
    yarn config set ignore-engines true
    

Yarn Install –Force报错解决

[centos@ip-10-20-13-202 halin]$ yarn install --force
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
error vis-util@1.1.10: The engine "node" is incompatible with this module. Expected version ">=8". Got "6.17.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
  • 升级Node.js版本
    sudo npm cache clean -f
    sudo npm install -g n
    sudo n stable
    
Failed to compile
multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./src/index.js
Module not found: Syntax/home/centos/halin/src/package.json (directory description file): SyntaxError: /home/centos/halin/src/package.json (directory description file): SyntaxError: Unexpected token . in JSON at position 0
This error occurred during the build time and cannot be dismissed.
Failed to compile
multi ./node_modules/react-dev-utils/webpackHotDevClient.js ./src/index.js
Module not found: Syntax/home/centos/halin/src/package.json (directory description file): SyntaxError: /home/centos/halin/src/package.json (directory description file): SyntaxError: Unexpected token . in JSON at position 0
  • 解决方法【下载最新发布包重试install过程】
    https://github.com/moxious/halin/releases/tag/v0.15.0
    
下载下面的安装包启动:
https://github.com/ongdb-contrib/halin/releases/tag/v0.11.3
yarn install
yarn start
Navigate to http://localhost:3000/
ongdb-version-3.5.x