lse123's avatar

homestead2.test/login - but Not loading app.css, app.js from

Route::get('/login', function () { return view('auth.login'); })->name('login'); // http://homestead2.test/login

I scaffold js in Laravel 7.x but Not loading app.css, app.js from // what to do?

code\MyApp\resources\views\layouts\app.blade.php

see screenshot here:

https://yadi.sk/i/WGgXLvTKsLpIAg

vagrant@homestead:~/MyApp$ npm install && npm run dev npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code EPROTO npm ERR! syscall symlink npm ERR! path ../@babel/parser/bin/babel-parser.js npm ERR! dest /home/vagrant/MyApp/node_modules/.bin/parser npm ERR! errno -71 npm ERR! EPROTO: protocol error, symlink '../@babel/parser/bin/babel-parser.js' -> '/home/vagrant/MyApp/node_modules/.bin/parser'

npm ERR! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2020-06-24T18_02_36_031Z-debug.log vagrant@homestead:~/MyApp$

0 likes
5 replies
lse123's avatar

I scaffold js in Laravel 7.x but Not loading app.css, app.js from // what to do?

code\MyApp\resources\views\layouts\app.blade.php

code\MyApp\resources\sass\app.scss // this needed compiled to css??? if yes, when do so, how access CSS and JS files from resources\views\layouts\app.blade.php?

siangboon's avatar

when you run npm run dev, it should compile the sass and js file from the resources folder output into public/js and public/css

but before that, npm install have to be executed before npm run dev to ensure all the dependencies are in place.

in your case, it seem errors (npm ERR! code EPROTO npm ERR! syscall symlink npm ERR! path ../@babel/parser/bin/babel-parser.js...) while executing the npm command... hence no output file processed...

i didn't use vagrant and babel etc, can't help much but suggest that run the npm instsall and npm run dev separately to easy identify where the error is...

lse123's avatar

FAILING //// npm install //// npm run dev //// WHAT TO DO...?

Last login: Wed Jun 24 18:00:56 2020 from 10.0.2.2 vagrant@homestead:~$ cd MyApp/ vagrant@homestead:~/MyApp$ npm install npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code EPROTO npm ERR! syscall symlink npm ERR! path ../@babel/parser/bin/babel-parser.js npm ERR! dest /home/vagrant/MyApp/node_modules/.bin/parser npm ERR! errno -71 npm ERR! EPROTO: protocol error, symlink '../@babel/parser/bin/babel-parser.js' -> '/home/vagrant/MyApp/node_modules/.bin/parser'

npm ERR! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2020-06-25T20_34_43_066Z-debug.log vagrant@homestead:~/MyApp$ exit logout Connection to 127.0.0.1 closed.

lwdls@PC8 MINGW64 /f/htdocs_xampp/Laravel/Homestead2020 (master) $ vagrant suspend ==> homestead: Saving VM state and suspending execution...

lwdls@PC8 MINGW64 /f/htdocs_xampp/Laravel/Homestead2020 (master) $ vagrant up Bringing machine 'homestead' up with 'virtualbox' provider... ==> homestead: Checking if box 'laravel/homestead' version '9.4.0' is up to date... ==> homestead: A newer version of the box 'laravel/homestead' is available and already ==> homestead: installed, but your Vagrant machine is running against ==> homestead: version '9.4.0'. To update to version '9.5.1', ==> homestead: destroy and recreate your machine. ==> homestead: Resuming suspended VM... ==> homestead: Booting VM... ==> homestead: Waiting for machine to boot. This may take a few minutes... homestead: SSH address: 127.0.0.1:2222 homestead: SSH username: vagrant homestead: SSH auth method: private key ==> homestead: Machine booted and ready! ==> homestead: Machine already provisioned. Run vagrant provision or use the --provision ==> homestead: flag to force provisioning. Provisioners marked to run always will still run.

lwdls@PC8 MINGW64 /f/htdocs_xampp/Laravel/Homestead2020 (master) $ vagrant ssh Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-91-generic x86_64)

| | | | | | | |__ ___ _ __ ___ ___ | | ___ __ _ | | | ' \ / _ | ' _ \ / _ \/ __| __/ _ \/ _ |/ ` | | | | | () | | | | | | _/_ \ || __/ (| | (| | || ||_/|| || |_|_||/__|_,|_,|

  • Homestead v10.9.1

  • Settler v9.5.1 (Virtualbox, Parallels, Hyper-V, VMware)

  • Canonical Livepatch is available for installation.

0 packages can be updated. 0 updates are security updates.

Last login: Thu Jun 25 20:34:01 2020 from 10.0.2.2 vagrant@homestead:~$ cd MyApp/ vagrant@homestead:~/MyApp$ npm run dev

@ dev /home/vagrant/MyApp npm run development

@ development /home/vagrant/MyApp 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: not found npm ERR! code ELIFECYCLE npm ERR! syscall spawn npm ERR! file sh npm ERR! errno ENOENT 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! spawn ENOENT npm ERR! npm ERR! Failed at the @ development script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2020-06-25T20_39_29_707Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ dev: npm run development npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2020-06-25T20_39_29_717Z-debug.log vagrant@homestead:~/MyApp$

siangboon's avatar

try run vagrant as an administrator, and use sudo to npm install

lse123's avatar

same thing errors

vagrant@homestead:~$ cd MyApp/ vagrant@homestead:~/MyApp$ sudo npm install npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code EPROTO npm ERR! syscall symlink npm ERR! path ../@babel/parser/bin/babel-parser.js npm ERR! dest /home/vagrant/MyApp/node_modules/.bin/parser npm ERR! errno -71 npm ERR! EPROTO: protocol error, symlink '../@babel/parser/bin/babel-parser.js' -> '/home/vagrant/MyApp/node_modules/.bin/parser'

npm ERR! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2020-06-28T09_35_26_106Z-debug.log vagrant@homestead:~/MyApp$

Please or to participate in this conversation.