如果用apt-get来安装,nodejs的版本很低0.10.37
。
使用Ubuntu推荐的安装方式:
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
1 安装Nodejs 4.x版本. (curl前面是否加sudo和系统用户的配置有关,如果不加也能运行,就不用加sudo)
$sudo curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
$sudo apt-get install -y nodejs
check
$ nodejs -v
v4.4.0
$ npm -v
2.14.20
2 有些库还需要安装编译环境
To compile and install native addons from npm you may also need to install build tools:
sudo apt-get install -y build-essential
check
$ g++ --version
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
3 安装SSE的包
$ npm install express consolidate handlebars caesar
$ sudo npm install -g coffee-script
check
$ coffee -c ./searchable.coffee
能够得到编译后的js文件
如何运行我还不清楚?