问题描述
我正在尝试尽可能多地使用自制软件.在OS X上安装以下内容的建议方法是什么?
I am trying to use homebrew as much as possible. What's the suggested way to install the following on OS X?
- node.js
- io.js
- nvm
- npm
并希望支持以下项目的开发:
and hopefully supports development for:
- ionic
- ngCordova
推荐答案
-
使用
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
安装node
或iojs
(可以安装所需的任何版本):
Using nvm
install node
or iojs
(you can install any version you want):
nvm install 0.10
# or
nvm install iojs-1.2.0
npm
随node
(或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
.感谢@Metallica指出了正确的方法(请看下面的评论).
. Thanks to @Metallica for pointing to the correct way (look at the comment bellow).
使用npm
安装ionic
:
npm install -g ionic
关于ngCordova
的情况:您可以使用npm
或bower
安装它.我不知道哪种变体更适合您,这取决于您要在客户端使用的包管理器.因此,我将同时描述它们:
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:
-
使用
npm
:转到项目文件夹并在其中安装ng-cordova
:
npm install --save ng-cordova
使用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
PS
- 某些命令可能需要超级用户特权
-
npm install some_module
的短变体是npm i some_module
- Some commands may require superuser privilege
- Short variant of
npm install some_module
isnpm i some_module
这篇关于在OS X上安装brew,node.js,io.js,nvm,npm的建议方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!