nodejs meanjs meanio yo等

来源:互联网 发布:UC数据库设计 编辑:程序博客网 时间:2024/04/30 23:16

最近被mean的架构吸引 mongodb express angularjs node

于是在虚拟机上搭建环境,整了几天,终于完成,记录下碰到过的一些问题

步骤一

首先安装nodejs 和 npm

在一堆网络问题和版本问题的驱动下 找到了taobao的npm镜像 推荐使用 npm.taobao.org上去看一下

问题1

Error: CERT_UNTRUSTED

registry 已经将https头改成http头依然没用

解决方法:

npm install npm -g --ca="" 或者 npm config set ca ""

问题2

npm list -g 报错一堆error npm ERR! invalid: async-series@0.0.1 /usr/lib/node_modules/mean-cli/node_modules/async-series

总之告诉你有依赖包没装

解决办法 升级nodejs npm 以及npm update


步骤二

安装yo grunt

npm install -g grunt-cli bower


安装后用yo尝试生成  根本没有在线说明那么美好。。

问题3

最直接的问题是root权限 不支持以及bower install也是对root执行有问题

解决方法:直接生猛的chmod 777 /root/以及bower install --allow-root


步骤三

安装完后yo可以运行了 生成了一堆文件 bowerinstall 和npm install 看着也好了

grunt server

问题4

Warning: not found: compass Use --force to continue.

由于这个报错的warning 直接fail了

尝试找了一些资料  需要compass 组件

解决办法:

安装ruby ruby-devel rubygems 以及gem install compass


问题5

gem国内被墙住了。。

解决方法:修改

gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
gem sources -l
gem install compass


再进行grunt server

成功起来了


问题6

可是外面通过Ip依然访问不了

解决:grunt-file 里面有

// Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',

修改成0.0.0.0就可以了~



至此 终于完成了yo的安装和服务器启动~~~
















0 0
原创粉丝点击