jeudi 2 août 2018

Laravel CSS and JS not working in production

I created a bitbucket project working properly locally on Xampp server and on MySQL Forge Digital Ocean server. For performance reason, i wanted to to switch to MariaDb so deleted my droplet through Forge and create a new one on which I uploaded my bucket. Since then the new website has no CSS or JS display.By SSH I can check all folders are one server and public folder has all necessary files (migrations were done, composer run during deployment and npm run prod was done locally before adding to bucket) I tried SSHing and running npm run prod directly on server, I got :

npm run production sh: 1: cross-env: not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! @ production: cross-env NODE_ENV=production node_modules/webpack/bin/w
ebpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/w ebpack.config.js
npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the @ production script. npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above. npm WARN Local package.json exists, but node_modules missing, did you mean to in

So i run npm install

npm WARN notice [SECURITY] atob has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=atob&version=1.1.3 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] is-my-json-valid has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=is-my-json-valid&version=2.17.1 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=3.10.1 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] sshpk has the following vulnerability: 1 high. Go here for more details: https://nodesecurity.io/advisories?search=sshpk&version=1.13.1 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] tunnel-agent has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=tunnel-agent&version=0.4.3 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] stringstream has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=stringstream&version=0.0.5 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] ssri has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=ssri&version=5.2.1 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] atob has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=atob&version=2.0.3 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] randomatic has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=randomatic&version=1.1.7 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] macaddress has the following vulnerability: 1 critical. Go here for more details: https://nodesecurity.io/advisories?search=macaddress&version=0.2.8 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] hoek has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info. npm WARN notice [SECURITY] deep-extend has the following vulnerability: 1 low. Go here for more details: https://nodesecurity.io/advisories?search=deep-extend&version=0.4.2 - Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info.

node-sass@4.7.2 install /home/forge/cryptohappen.com/node_modules/node-sass node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/linux-x64-57_binding.node Download complete ] - : Binary saved to /home/forge/mywebsite.com/node_modules/node-sass/vendor/linux-x64-57/binding.node Caching binary to /home/forge/.npm/node-sass/4.7.2/linux-x64-57_binding.node

uglifyjs-webpack-plugin@0.4.6 postinstall /home/forge/mywebsite.com/node_modules/webpack/node_modules/uglifyjs-webpack-plugin node lib/post_install.js

node-sass@4.7.2 postinstall /home/forge/mywebsite.com/node_modules/node-sass node scripts/build.js

Binary found at /home/forge/mywebsite.com/node_modules/node-sass/vendor/linux-x64-57/binding.node Testing binary Binary is fine

gifsicle@3.0.4 postinstall /home/forge/mywebsite.com/node_modules/gifsicle node lib/install.js

✔ gifsicle pre-build test passed successfully

mozjpeg@5.0.0 postinstall /home/forge/mywebsite.com/node_modules/mozjpeg node lib/install.js

✔ mozjpeg pre-build test passed successfully

optipng-bin@3.1.4 postinstall /home/forge/mywebsite.com/node_modules/optipng-bin node lib/install.js

✔ optipng pre-build test passed successfully

pngquant-bin@3.1.1 postinstall /home/forge/mywebsite.com/node_modules/pngquant-bin node lib/install.js

⚠ The /home/forge/mywebsite.com/node_modules/pngquant-bin/vendor/pngquant binary doesn't seem to work correctly ⚠ pngquant pre-build test failed ℹ compiling from source ✖ Error: pngquant failed to build, make sure that libpng-dev is installed at ChildProcess.exithandler (child_process.js:275:12) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Then, now npm run prod compile on server successfully but still no css and js on website.

Between my previous droplet and this new one I didnt modify my code which is still working locally so it must be related to Forge setting. Creating a 3rd droplet the same way as the 1st i.e with a MySQL Db gives me same issue



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

Aucun commentaire:

Enregistrer un commentaire