问题
I got a sailsjs app on a debian server. My only user is root, I installed everything in root (npm install, npm install sails -g, npm install pm2 -g). When I try to deploy it with my root user (sails lift --prod), I got permissions errors :
Grunt :: Running "clean:dev" (clean) task
Grunt :: Cleaning .tmp/public...
Grunt :: Warning: Cannot delete files outside the current working directory.
** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
Aborted due to warnings.
Running "clean:dev" (clean) task
Cleaning .tmp/public...Warning: Cannot delete files outside the current working directory.
------------------------------------------------------------------------
I checked permissions for every folder, they are all owned by root.
Anyone got that problem ?
Thank you very much
回答1:
Looks like, you updated your Node.Try to delete .tmp folder Also edit tasks/config/clean.js:
grunt.config.set('clean', {
options: { force: true },
dev: ['.tmp/public/**'],
build: ['www']
});
回答2:
You can add
options: { force: true }
option to Grunt task
Also, can you provide full Gruntfile?
来源:https://stackoverflow.com/questions/35624877/sails-js-permissions