首页 > 网站 > WEB开发 > 正文

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

2024-04-27 15:15:59
字体:
来源:转载
供稿:网友

背景:偶然看到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 theC++ 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 withclang-3.4. Ubuntu Precise ships withclang-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 thegcc 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 这里有篇文章可以进行参考


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表