Larave5权限问题

我有一个简单的脚本来启动和运行本地/开发机器的docker环境。 在脚本里面我设置了导致问题的项目权限任务:

一个版本的任务:

- name: Set permissions shell: > sudo chown -R {{local_user}}:{{wwwdata}} {{project_root}} && sudo chmod ug+w -R {{project_root}} && sudo chgrp -R www-data {{project_root}}/storage {{project_root}}/bootstrap/cache && sudo chmod -R ug+rwx {{project_root}}/storage {{project_root}}/bootstrap/cache 

和所有工作正常,直到我们需要存储/更改storage目录中的东西。 ig我们不能logging命令行信息。

另一个版本:

 - name: Set permissions shell: > sudo chown -R {{local_user}}:{{wwwdata}} {{project_root}} && sudo find {{project_root}} -type f -exec chmod 664 {} \; && sudo find {{project_root}} -type d -exec chmod 775 {} \; && sudo chgrp -R www-data {{project_root}}/storage {{project_root}}/bootstrap/cache && sudo chmod -R ug+rwx {{project_root}}/storage {{project_root}}/bootstrap/cache 

我在这里面临的问题是当我从我的用户运行npm run dev我得到的错误:

 > @ development /var/www/vhosts/project > cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js sh: 1: cross-env: Permission denied npm ERR! Linux 4.2.0-42-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "development" npm ERR! node v6.11.5 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` npm ERR! Exit status 126 npm ERR! npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /var/www/vhosts/project/npm-debug.log npm ERR! Linux 4.2.0-42-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev" npm ERR! node v6.11.5 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! @ dev: `npm run development` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ dev script 'npm run development'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run development npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls npm ERR! There is likely additional logging output above. 

FYI: npm install正常工作

我将不胜感激任何帮助!