Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
868 views
in Technique[技术] by (71.8m points)

vagrant - When should I execute commands on my host OS and when should I execute commands on my Laravel Homestead virtual machine?

I am using Laravel Homestead and Vagrant to develop Laravel-applications and I'm lost in when to execute commands on my host OS and when to execute commands on my virtual machine (Laravel Homestead).

Recently I tried to install all the standard-dependencies of my fresh Laravel-project with NPM by executing the "npm install"-command on my Laravel Homestead virtual machine and it didn't allow me to do by giving me errors after errors about NPM not being able to find a file.

When I searched on how to fix it I saw a post from someone on this forum which told to execute "npm install" on the host OS.

When I did that, it worked but later i stumbled over another problem where I wanted to create a model by using the command "php artisan make:model".

I executed this command on my host OS and it didn't work but it did work on my virtual machine.

Every answer is appreciated!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Homestead is an isolated environment and everything should be executed inside VM and in normal circumstances, everything should be working.

simply imagine that you are using remote-VM over ssh without sync. Where you would run your commands? The same rule applies to local-VM.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...