cemtos编译安装nodec

nodec是一款打包nodejs源码的工具
首先安装编译环境:

yum install squashfs-tools -y

下载nodec程序

curl -L http://enclose.io/nodec/nodec-linux-x64.gz | gunzip > nodec
chmod +x nodec
./nodec

将其放到系统目录

mv nodec /usr/local/bin/
ln -s /usr/local/bin/nodec /usr/bin/nodec

接着介绍用法:
编译命令行工具

git clone --depth 1 https://github.com/jashkenas/coffeescript.git
cd coffeescript
nodec bin/coffee
./a.out (or a.exe on Windows)

编译web应用程序:

git clone --depth 1 https://github.com/eggjs/examples.git
cd examples/helloworld
npm install
nodec node_modules/egg-bin/bin/egg-bin.js
./a.out dev (or a.exe dev on Windows)

编译一个rpm包

nodec --npm-package=coffee-script coffee
./a.out (or a.exe on Windows)
点赞