2016-06-10 94 views
0
推出

我已如果我启动它SailsJS应用程序工作正常:SailsJS APP不PM2

$ 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

+0

能否请您尝试使用sudo PM2开始app.js -x - --prod – hlozancic

+0

我试过了。不起作用。 –

+0

我几乎100%确定您有权限问题...尝试更换所有者或其他内容。 Grunt无法写入.tmp文件夹... – hlozancic

回答

0

你尝试: -

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