背景:偶然看到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的
結果表示網速不給力還是網站不給力的 硬是下載不成功 臉黑:(
然后發現還有一招
Alternatively, for Node.js v7:
運行下下面的命令就可以了
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -sudo apt-get install -y nodejsOptional: 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了
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 這里有篇文章可以進行參考
|
新聞熱點
疑難解答