jeudi 30 novembre 2017

Larave5 permissions issue

I have a simple ansible script to up and run docker environment for local/development machines. Inside the script I have set project permissions task which caused the problems:

One version of the task:

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

and all working fine until we need to store/change something in storage directory. i.g we can't log command line information.

Another version:

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

the issue I'm facing here is when I running npm run dev from my user I got the error:

> @ 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 working fine

I would appreciate any help!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2zC1FlW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire