我是meteorjs的新手。我创建了一个使用Meteor UP(MUP)上传到服务器的应用程序。我有专门安装了cPanel的linux服务器。我可以通过SSH访问服务器。
我在本地设置上安装了Windows 7,我尝试部署应用程序。我创建了一个私钥,并与MUP一起使用它来部署应用程序。但是当我在命令提示符下运行mup setup
时,它会给我以下错误:
Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
Started TaskList: Setup
[207.244.66.193] - Installing Node.js
[207.244.66.193] ? Installing Node.js: FAILED
spawn ENOENT
Completed TaskList: Setup
这是我的mup.json文件
{
// Server authentication info
"servers": [
{
"host": "xxx.xxx.xx.xxx",
"username": "devmain",
//"password": "password"
// or pem file (ssh based authentication)
"pem": "/Users/Jackal/Desktop/mup1"
}
],
// Install MongoDB in the server, does not destroy local MongoDB on future setup
"setupMongo": true,
// WARNING: Node.js is required! Only skip if you already have Node.js installed on server.
"setupNode": true,
// WARNING: If nodeVersion omitted will setup 0.10.25 by default. Do not use v, only version number.
"nodeVersion": "0.10.25",
// Install PhantomJS in the server
"setupPhantom": true,
// Application name (No spaces)
"appName": "myappname",
// Location of app (local directory)
"app": "/Users/Jackal/Desktop/app",
// Configure environment
"env": {
"PORT": 3000,
"ROOT_URL": "http://myapp.com"
},
// Meteor Up checks if the app comes online just after the deployment
// before mup checks that, it will wait for no. of seconds configured below
"deployCheckWaitTime": 15
}
有人可以在这里找出我的错误吗?
答案 0 :(得分:2)
由于您正在运行cPanel,因此很可能您没有运行基于debian的操作系统,因为它只支持基于redhat的系统,因为MeteorUP依赖于apt
命令,而这仅适用于基于debian的命令系统,MeteorUP将不工作。
要在生产环境中运行您的应用,您可以使用systemd:
[Service]
ExecStart=[path_to_your_meteor_cmd] [path_to_your_app]
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=[your_app_name]
User=[user_it_runs_under]
Group=[group_it_runs_under]
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
将其另存为[your_app_name].service
,并在将每个[]
替换为正确值后,将脚本放在/etc/systemd/system/
中,然后运行命令systemctl enable [appname].service
和systemctl start [appname].service
,启动将在重启/崩溃后自动启动您的应用程序。
以下是我的参考资料:
[Service]
ExecStart=/usr/local/bin/meteor /home/meteor-run/spottr/
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=spottr
User=spottr
Group=spottr
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target