Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
887 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...