查看: 2909|回复: 2
收起左侧

[参考教程] 树莓派3上面安装Node.js

2016-3-10 17:35:55 | 显示全部楼层 |阅读模式
笔记。
Install Node.js
You now have an amazing general purpose Raspberry Pi system that can be used for a variety of tasks and inter-operates well in the Windows world (it even looks like a Windows machine to the other Windows machines!) – and can play nicely in the Mac and Linux world too.  Let’s go ahead and install Node.js so we will be ready to do some fun projects in the future.  Here are the steps:

Our friends at NodeSource host and maintain some excellent Node.js binary distributions.  We will leverage a command they have written to add another package repository to our RasPi so that we will be able to “apt-get install” a modern version of Node.js from their repository.  This is beneficial since the Debian/Raspbian versions may not always be up to date.  By adding the NodeSource repository, we will also be able to receive updates rather than just installing a standalone (.deb) file version of Node that cannot be updated easily.  Here we go in the final stretch:

Let’s go for an installation of the latest version of Node at the time of this writing which is Node 5.X.

  1. $ curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
复制代码

The previous command updates our package repository to include the NodeSource packages.  Now, let’s install Node.js!

  1. $ sudo apt-get install -y nodejs
复制代码

We can then test and see what version of Node we are running and launch the Node REPL as we discussed inthe previous articleas a quick test to confirm the installation was successful.

  1. $ node -v
  2. v5.6.0
  3. $ node
  4. > 1 + 3
  5. 4
  6. > # We can hit Ctrl-C twice to exit the REPL and get back to the bash (shell) prompt.
复制代码
回复

使用道具 举报

2016-5-4 23:25:29 | 显示全部楼层
#install nodejs
sudo apt-get install nodejs npm

node -v
v0.10.29

回复 支持 反对

使用道具 举报

2017-10-16 03:09:12 | 显示全部楼层
谢谢,学习了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注我们,了解更多

官方微信

服务时间:10:00-16:00

13714503811

公司地址:深圳市龙岗区南湾街道东门头路8号

Copyright © 2012-2020 Powered by 树莓派论坛 2019.4  粤ICP备15075382号-1
快速回复 返回列表 返回顶部