【问题标题】:SailsJS app not launching with PM2SailsJS 应用程序未使用 PM2 启动
【发布时间】:2016-10-11 19:10:41
【问题描述】:

我有一个 SailsJS 应用程序,如果我启动它就可以正常工作:

$ sails lift

$ sudo nohup node app.js

但如果我尝试以以下方式开始:

$ pm2 start app.js -x -- --prod

它给出了这样的错误:

app-0 (err): ------------------------------------------------------------------------ app-0 (err): Aborted due to warnings. app-0 (err): Running "clean:dev" (clean) task app-0 (err): Cleaning .tmp/public...ERROR app-0 (err): Warning: Unable to delete ".tmp/public" file (EACCES: permission denied, unlink '.tmp/public/base.html'). app-0 (err): ------------------------------------------------------------------------ app-0 (err): error: Looks like a Grunt error occurred-- app-0 (err): error: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets) app-0 (err): error: Or if you're stuck, check out the troubleshooting tips below. app-0 (err): error: Troubleshooting tips: app-0 (err): error: app-0 (err): error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure. app-0 (err): error: app-0 (err): error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc. app-0 (err): error: app-0 (err): error: *-> Or maybe you don't have permissions to access the `.tmp` directory? app-0 (err): error: e.g., `/home/anubhav/wishup/opsdashboard-nodejs/.tmp` ? app-0 (err): error: app-0 (err): error: If you think this might be the case, try running: app-0 (err): error: sudo chown -R 1000 /home/anubhav/wishup/opsdashboard-nodejs/.tmp

【问题讨论】:

  • 能否请您尝试使用 sudo pm2 start app.js -x -- --prod
  • 我试过了。没用。
  • 我几乎 100% 确定您的权限有问题...尝试更改所有者或其他方式。 Grunt 无法在 .tmp 文件夹上写入...

标签: node.js gruntjs sails.js pm2


【解决方案1】:

您是否尝试过:-

sudo rm -rf .tmp/public
cd <you project dir >
sudo npm install 
sudo  NODE_ENV=production pm2 start app.js 

【讨论】:

    猜你喜欢
    • 2015-04-11
    • 2015-08-26
    • 2016-12-10
    • 1970-01-01
    • 1970-01-01
    • 2022-08-06
    • 1970-01-01
    • 2020-10-15
    • 2016-05-08
    相关资源
    最近更新 更多