您的位置:首页 > Web前端 > Node.js

Node.js初体验 Kali安装Node.js

2017-02-08 23:27 363 查看
背景:偶然看到node.js开发微信公众号的视频,有些好奇,想要接触下。然后花了两个小时在实验楼网站上在线学习了JavaScript的基础知识,以及Node.js的基础

接着本着从实践出发的原则 先去本地kali下安装个Node.js玩玩

下载地址:https://nodejs.org/en/download/

网页最下面有提示:Note: Python 2.6 or 2.7 is required to build from source tarballs.  需要python 2.6或者2.7的环境

然后终端下 python -V 看了下版本 还好 正好是2.7的

结果表示网速不给力还是网站不给力的 硬是下载不成功 脸黑:(

然后发现还有一招 

Installing Node.js via package manager

使用安装包管理器进行安装 ,url: https://nodejs.org/en/download/package-manager/
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs


Alternatively, for Node.js v7:

运行下下面的命令就可以了

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs

Optional: install build tools

To compile and install native addons from npm you may also need to install build tools:

sudo apt-get install -y build-essential

因为是kali的 基于Debian的

查了下版本 反正高于Debian7的 如果没有的话 那只能装下低版本的nodejs了

Debian Style Distributions

Two such examples that highlight this situation are the Debian Wheezy and Ubuntu Precise releases. Both are still currently receiving security updates. However, the default versions of the
C++
compilers that each ships with are not modern enough to build the current iterations of the V8 Javascript engine.

In order to get around this issue, we build the packages <= v6.x for Debian Wheezy with
clang-3.4.
Ubuntu Precise ships with
clang-3.4 available, so we use that instead of GCC.

The current expectation for v7.x of Node is that going forward, it will require use of even newer parts of the C++ standard than v6.x did. This will in turn require a compiler newer than both the
gcc
that ships on these distributions and
clang-3.4
. For this reason,
we do not support Wheezy or Precise on version 7.x of Node.

看下最终结果



至于如果使用源代码进行编译安装的话
http://www.cnblogs.com/zhoulf/p/4042888.html 这里有篇文章可以进行参考
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: