发布于 2016-10-18 04:57:54 | 767 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的Node.js主要方法使用说明,程序狗速度看过来!

Node.js 服务器端的JavaScript

Node.js 是一个基于Chrome JavaScript 运行时建立的一个平台, 用来方便地搭建快速的 易于扩展的网络应用· Node.js 借助事件驱动, 非阻塞I/O 模型变得轻量和高效, 非常适合 运行在分布式设备 的 数据密集型 的实时应用


默认使用软件中心安装node.js,然后参考https://famo.us/install进行安装

1.sudo apt-get install git

2.npm install -g yo grunt-cli bower generator-famous 执行后结果报如下错误 使用npm WARN This failure might be due to the use of legacy binary "node"

经过搜索采取如下方式安装最新node.js

----------------------------------------------------------------------------------------------------------------

1.确定/etc/apt/sources.list中存在如下源信息

# in /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu quantal main restricted universe

deb http://security.ubuntu.com/ubuntu quantal-security main restricted universe

deb http://archive.ubuntu.com/ubuntu quantal-updates main restricted universe

2.执行如下操作安装node.js

sudo apt-get install python-software-properties

sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get update sudo apt-get install nodejs

3.执行如下操作安装npm

sudo apt-get install npm

----------------------------------------------------------------------------------------------------------

3.mkdir newProject && cd newProject

4.yo famous

5.grunt serve

参考链接:

http://slopjong.de/2012/10/31/how-to-install-the-latest-nodejs-in-ubuntu/



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务