You could compile the production build on local and push the compiled CSS and JS to the server.
In any case, npm run prod not npm run dev for production!
I am using Vue 2.0. Everything works on the dev server. I am now moving all my code to the production server on DigitalOcean, and Laravel gives the above error. Yes I have installed npm and I did npm run dev. This generates a raft of errors in the Terminal, all referring to permissions.
I have checked SO and there are so many suggestions, that I don't trust any of them. I have tried running sudo npm run dev to no avail. Is my only course to go through each and every file and mkdir on each one or is there some global solution?
Many Thanks!
npm run development
> development
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
Additional dependencies must be installed. This will only take a moment.
Running: npm install vue-template-compiler --save-dev --production=false
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /var/www/html/node_modules/vue-template-compiler
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/var/www/html/node_modules/vue-template-compiler'
npm ERR! { [Error: EACCES: permission denied, mkdir '/var/www/html/node_modules/vue-template-compiler']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, mkdir \'/var/www/html/node_modules/vue-template-compiler\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/var/www/html/node_modules/vue-template-compiler' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vince/.npm/_logs/2021-03-29T23_21_09_639Z-debug.log
/var/www/html/node_modules/webpack-cli/bin/cli.js:93
throw err;
^
Error: Command failed: npm install vue-template-compiler --save-dev --production=false
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /var/www/html/node_modules/vue-template-compiler
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/var/www/html/node_modules/vue-template-compiler'
npm ERR! { [Error: EACCES: permission denied, mkdir '/var/www/html/node_modules/vue-template-compiler']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, mkdir \'/var/www/html/node_modules/vue-template-compiler\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/var/www/html/node_modules/vue-template-compiler' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vince/.npm/_logs/2021-03-29T23_21_09_639Z-debug.log
I didn't alter my suggestion, which is weird.
But it looks like your user/group setup was not done properly. Look at the following, which will most likely help you fixing these permission errors : https://stackoverflow.com/a/37266353
Please or to participate in this conversation.