在 OS X 上安装 brew、node.js、io.js、nvm、npm 的建议方法是什么? [英] What is the suggested way to install brew, node.js, io.js, nvm, npm on OS X?

查看:16
本文介绍了在 OS X 上安装 brew、node.js、io.js、nvm、npm 的建议方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试尽可能多地使用自制软件.在 OS X 上安装以下内容的建议方法是什么?

I am trying to use homebrew as much as possible. What's the suggested way to install the following on OS X?

并希望支持以下开发:

推荐答案

  1. 使用homebrew安装nvm:

brew update
brew install nvm
source $(brew --prefix nvm)/nvm.sh

将最后一条命令添加到 .profile.bashrc.zshrc 文件中,以免在每次终端启动时再次运行它.因此,例如将其添加到 .profile 运行:

Add the last command to the .profile, .bashrc or .zshrc file to not run it again on every terminal start. So for example to add it to the .profile run:

echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.profile

如果您在使用 brew 安装 nvm 时遇到问题,您可以手动安装(请参阅 此处)

If you have trouble with installing nvm using brew you can install it manually (see here)

使用 nvm 安装 nodeiojs(你可以安装任何你想要的版本):

Using nvm install node or iojs (you can install any version you want):

nvm install 0.10
# or
nvm install iojs-1.2.0

  • npmnode(或 iojs)一起提供,所以它在安装 node 后可用代码>(或 iojs).您可能希望将其升级到最新版本:

  • npm is shipping with node (or iojs), so it will be available after installing node (or iojs). You may want to upgrade it to the latest version:

    $ npm install -g npm@latest
    

    UPD 以前的版本是 npm update -g npm.感谢@Metallica 指出正确的方法(请看下面的评论).

    UPD Previous version was npm update -g npm. Thanks to @Metallica for pointing to the correct way (look at the comment bellow).

    使用npm安装ionic:

    npm install -g ionic
    

  • ngCordova 怎么样:你可以使用 npmbower 安装它.我不知道哪种变体更适合您,这取决于您要用于客户端的包管理器.所以我将描述它们:

  • What about ngCordova: you can install it using npm or bower. I don't know what variant is more fit for you, it depends on the package manager you want to use for the client side. So I'll describe them both:

    1. 使用 npm:转到您的项目文件夹并在其中安装 ng-cordova:

    npm install --save ng-cordova
    

  • 使用bower:安装bower:

  • Using bower: Install bower:

     npm install -g bower
    

    然后转到您的项目文件夹并在其中安装 ngCordova:

    And then go to your project folder and install ngCordova in it:

     bower install --save ngCordova
    

  • 附注

    1. 某些命令可能需要超级用户权限
    2. npm install some_module 的简短变体是 npm i some_module
    1. Some commands may require superuser privilege
    2. Short variant of npm install some_module is npm i some_module

    这篇关于在 OS X 上安装 brew、node.js、io.js、nvm、npm 的建议方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆