node.js mongoose的安装和使用

    正常情况下我们安装了node.js会自带npm ,所以直接terminal输入指令就可以,如下三个步骤。

1, install node-v4.3.1-darwin-x64.tar

2,install mongoose

   Open terminal  run “ npm install mongoose ”.

3, Open terminal, go to project folder, run "mongoose" command

Mobiles-MacBook-Pro:~ Mobile$ cd 你项目的路径

Mobiles-MacBook-Pro:你项目的路径 Mobile$ mongoose

但是由于各种什么墙的问题,正常会出现找不到mongoose指令的提示,所以建议使用brew install mongoose指令,但是由于mac下面访问usr路径需要权限,所以建议你看清楚提示手动往对应的路径新建文件夹还有开启读写权限。


Mobiles-MacBook-Pro:~ Mobile$ brew install mongoose

==> Installing dependencies for mongoose: openssl

==> Installing mongoose dependency: openssl

==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2g.yosemite.bot

######################################################################## 100.0%

==> Pouring openssl-1.0.2g.yosemite.bottle.tar.gz

==> Caveats

A CA file has been bootstrapped using certificates from the system

keychain. To add additional certificates, place .pem files in

  /usr/local/etc/openssl/certs

 

and run

  /usr/local/opt/openssl/bin/c_rehash

 

This formula is keg-only, which means it was not symlinked into /usr/local.

 

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

 

Generally there are no consequences of this for you. If you build your

own software and it requires this formula, you'll need to add to your

build variables:

 

    LDFLAGS:  -L/usr/local/opt/openssl/lib

    CPPFLAGS: -I/usr/local/opt/openssl/include

 

==> Summary

?  /usr/local/Cellar/openssl/1.0.2g: 1,678 files, 12.0M

==> Installing mongoose

==> Downloading https://homebrew.bintray.com/bottles/mongoose-5.6.yosemite.bottl

######################################################################## 100.0%

==> Pouring mongoose-5.6.yosemite.bottle.2.tar.gz

?  /usr/local/Cellar/mongoose/5.6: 75 files, 371K

Mobiles-MacBook-Pro:~ Mobile$ pwd

/Users/Mobile

Mobiles-MacBook-Pro:~ Mobile$ mongoose

Mongoose web server v.5.6 serving [/Users/Mobile] on port 8080

mongoose^CExiting on signal 2 ... done.

Mobiles-MacBook-Pro:~ Mobile$ cd /你项目的路径

Mobiles-MacBook-Pro:你项目的路径 Mobile$ mongoose

Mongoose web server v.5.6 serving [/你项目的路径] on port 8080


出现8080,恭喜你成功了

 


转载于:https://my.oschina.net/u/1043582/blog/670150

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值