Ubuntu 14.04 安装node js

来源:互联网 发布:怎样淘宝上降价买东西 编辑:程序博客网 时间:2024/05/22 05:19

如果用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 -vv4.4.0$ npm -v2.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++ --versiong++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4Copyright (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文件

如何运行我还不清楚?

0 0
原创粉丝点击