Vuejs installed or not? - laravel

I am a beginner in Vuejs.I want to develop an application with laravel and Vuejs.I have follow the step of installing laravel and Vuejs and execute this composer create-project --prefer-dist laravel/laravel demo "5.8.*" command.I verify to check that Vuejs is installed or not by adding the extension of Vuejs in google chrome and it showing Vuejs is installed.But when i execute the command vue --version in the putty by connecting server through SSH then it shows error that "vue command not found".Why?
May be this question is not proper to ask but i am very confusing that actually Vuejs is installed or not.And is the Vuejs files structure is same or different?
Thanks in advance.

Installing and compiling vue into a laravel project is different than using the vue cli.
In Laravel, Vue is included in the assets registry in the package.json file.
npm uses this file to pull in assets then allows you to build them. It pulls them in with npm install
Note: you need node.js installed on your system.
The build commands you can see at the top of the package.json. They usually are:
npm run dev, npm run prod, and npm run watch.
Here is the documentation on getting started with Laravel and Vue:
https://laravel.com/docs/7.x/frontend

Related

Why npm run dev stuck on APP_URL?

Today when i tried to run npm run dev in Laravel 9 , it stucks at APP_URL line. Earlier there were no issues.enter image description here
Hope it's because of Vite
try with
npm run build
There is nothing wrong with your build. Laravel now uses Vite as front-end bundler. It is much more powerful than mix, so check out the documentation and get used to it. Or roll back to mix.
first solution : Laravel 9.19 replace the mixer with Vite, for Vite Configuration visit the official Doc of Laravel for Vite Bundling Assets (Vite)
second solution: install Laravel version 9.1.0 or lower
composer create-project Laravel/Laravel App_name 9.1.0
Uninstall and reinstall the npm package.
Delete the node_modules folder. and then run the following command
npm install
Later
npm install -g require

Error on Laravel after installing VueJS. Request failed with status 404

I am developing a small system with Laravel Framework 5.6.39 and everything was going well, until I installed Vue Js. When viewing in the browser, what should be displayed does not appear and the following appears in the console:
How can I solve this error?
I think you need to run:
npm run watch
After adding VueJS to your project you need to install all dependencies by executing:
npm install
Then you can either compile your assets onetime by executing:
npm run dev
Or start a watcher which compiles your assets automatically after detecting a filechange:
npm run watch
The compile process will generate the app.js file which is missing in your case. You can read more about this process or possibilities in laravel here (laravel docs about frontend).
After pulling your project you need to install all dependencies using
npm i
Then you can build it for development one-time using
npm run dev
Or for real-time updates
npm run watch
And when your project is ready for production
npm run prod

I am using Putty to run and compile vue js + laravel app on Godaddy VPS. Changes are not taking effect

I am using Putty to run and compile vue js + laravel app on Godaddy VPS. Changes are not taking effect.
I have Laravel + Vue.js App on VPS.
When I make changes in code, I am running following command in Putty.
npm run dev
npm run watch
Changes are not being applied. Even when it shows all modules built successfully.
npm run watch should apply changes in code.
In local environment using wamp it works
oh, have you tried laravel cached views clear??
php artisan cache:clear

laravel mix not working and my localhost:8000 not work

I create a laravel project with vue js. At first I have created laravel new project and then command npm install. and then command npm run dev
When I command in windows powershell: npm run watch
then whole things are compiled and then When I change somehing in app.js in laravel project and save this file. There is no notice about laravel mix. Besides When I write in my web browser: localhost:8000
I can't see my project. I can see a error message: This site can’t be reached
How can I solve this problem.

How do I make Example.vue update in Laravel?

I just read the answers to this question and wasn't able to get a good response.
Laravel Example.vue not updating
I also posted this question trying to figure it out on my own but to no avail.
how do I load a Vue component in Laravel 5.4?
As another attempt, I just did a new reinstall of Laravel, and while I am able to get the default Example.vue component to load multiple times in a single view, I am still unable to change the contents of the component. Funnier thing is that when I run npm install and then npm run dev, the component ceases to even show up anymore.
This is really frustrating because Laravel ships with Vue.js yet I am unable to utilize it. Any help would be much appreciated! :)
You need to install the node dependencies and then compile them.
Install node.js
From your projects root run npm install
From your projects root run npm run dev
Your browser may also be showing the cached version. Chrome has a setting that you can have the cache disabled while the inspector is open.
You can also check it by opening your project in other browsers.
If when running npm run dev dies without any message of any kind you can delete your node_modules folder then run npm install and then compile your assets again.
You may also need to clear and rebuild a few other caches with commands:
composer dump-autoload
php artisan clear-compiled
php artisan cache:clear
https://laravel.com/docs/5.4/mix
https://laravel.com/docs/5.4/frontend
Double check and make sure you're in the resources directory and not public. If you're in the correct directory try npm install then npm run watch

Resources