我尝试在 Google Cloud Platform(也是 KeystoneJS CMS)上部署 MEAN.JS,但它不起作用。我在线使用命令行工具。
按顺序,我安装了 Node.js、MongoDB、bower 和 grunt,然后我尝试部署 MEAN.JS:
安装 Node.js:
sudo apt-get install curl curl -sL https://deb.nodesource.com/setup | sudo bash - sudo apt-get install -y nodejs nodejs-legacy
安装 MongoDB:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list sudo apt-get update sudo apt-get install -y mongodb-org
安装 bower et Grunt :
sudo npm install -g bower sudo npm install -g grunt-cli
安装 MEAN.js:
sudo npm install -g generator-meanjs mkdir mean cd mean yo meanjs grunt
这是命令行板上的结果:
Running "jshint:all" (jshint) task
53 files lint free.
Running "csslint:all" (csslint) task
2 files lint free.
Running "concurrent:default" (concurrent) task
Running "watch" task
Running "nodemon:dev" (nodemon) task
Waiting...
[nodemon] v1.2.1
[nodemon] to restart at any time, enter
rs
[nodemon] watching: app/views//. gruntfile.js server.js config//.js app/*/*.j
s
[nodemon] starting node --debug server.js
debugger listening on port 5858
NODE_ENV is not defined! Using default development environment
js-bson: Failed to load c++ bson extension, using pure JS version
Failed to load c++ bson extension, using pure JS version
MEAN.JS application started on port 3000
我可以定义 NODE_ENV 变量(测试、开发、所有...),但这是同样的问题。
问题是:
它应该可以工作,但是当我尝试访问我的 IP:端口(在本例中为 146.148.113.68:3000)时:“此网页不可用”。
虚拟机、软件包、MEAN.JS 有问题吗?我对 KeystoneJS CMS 有同样的问题。
谢谢 !