2016-06-10 28 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