Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing packages #1234

Closed
ghost opened this issue Jul 11, 2019 · 12 comments
Closed

Removing packages #1234

ghost opened this issue Jul 11, 2019 · 12 comments

Comments

@ghost
Copy link

ghost commented Jul 11, 2019

I experienced this issue when I updated from Homestead 8.x to 9.0. In the meanwhile, I also have a fresh and clean Homestead but still experiencing this issue.

Versions

  • Vagrant: Vagrant 2.2.5
  • Provider: Virtualbox 6.0.8
  • Homestead: 9.0.3

Host operating system

Windows 10 1903

Expected behavior

When you remove packages, you will not receive an error message.

Actual behavior

When you remove packages, you get different error messages. When you want to update your Laravel you get the following errors.

Steps to reproduce

Fresh laravel

  1. composer create-project --prefer-dist laravel/laravel blog
  2. composer require --dev barryvdh/laravel-ide-helper && composer require --dev doctrine/dbal
  3. composer remove --dev barryvdh/laravel-ide-helper && composer remove --dev doctrine/dbal
PHP Parse error:  syntax error, unexpected ''Barryvdh' => array($vendorDir' (T_ENCAPSED_AND_WHITESPACE), expecting end of file in /home/vagrant/code/laravel/blog/vendor/composer/autoload_namespaces.php on line 13

Parse error: syntax error, unexpected ''Barryvdh' => array($vendorDir' (T_ENCAPSED_AND_WHITESPACE), expecting end of file in /home/vagrant/code/laravel/blog/vendor/composer/autoload_namespaces.php on line 13
  1. composer require nunomaduro/phpinsights --dev
  2. composer remove nunomaduro/phpinsights --dev
PHP Parse error:  syntax error, unexpected ''/ramsey/uuid/src'),' (T_ENCAPSED_AND_WHITESPACE) in /home/vagrant/code/laravel/blog/vendor/composer/autoload_psr4.php on line 67

Parse error: syntax error, unexpected ''/ramsey/uuid/src'),' (T_ENCAPSED_AND_WHITESPACE) in /home/vagrant/code/laravel/blog/vendor/composer/autoload_psr4.php on line 67

Used Laravel

  1. composer require --dev barryvdh/laravel-ide-helper && composer require --dev doctrine/dbal
  2. composer remove --dev barryvdh/laravel-ide-helper && composer remove --dev doctrine/dbal
PHP Parse error:  syntax error, unexpected ''Barryvdh' => array($vendorDir' (T_ENCAPSED_AND_WHITESPACE), expecting end of file in /home/vagrant/code/engageme/www/vendor/composer/autoload_namespaces.php on line 13

Parse error: syntax error, unexpected ''Barryvdh' => array($vendorDir' (T_ENCAPSED_AND_WHITESPACE), expecting end of file in /home/vagrant/code/engageme/www/vendor/composer/autoload_namespaces.php on line 13
  1. composer remove nunomaduro/phpinsights --dev
[RuntimeException]
  Could not delete /home/vagrant/code/engageme/www/vendor/theseer/fdomdocument/.git/objects/pack/pack-a8df3aab4538c18
  686696790caacd15e3b271da4.idx:

Afterwards you can't update or install anything and you have to remove the vendor folder manually. In the next step you have to use composer install --prefer-source

@svpernova09
Copy link
Contributor

svpernova09 commented Jul 11, 2019 via email

@ghost
Copy link
Author

ghost commented Jul 11, 2019

@svpernova09
Copy link
Contributor

The gist looks good.

What's the output of "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --version?

@ghost
Copy link
Author

ghost commented Jul 11, 2019

The gist looks good.

What's the output of "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --version?

6.0.8r130520

@svpernova09
Copy link
Contributor

6.0.8r130520

That looks good as well.

One last thing to check while I wait of my Vb + Win10 box to update to 1903:

Show me the full output of vagrant global-status

@ghost
Copy link
Author

ghost commented Jul 11, 2019

id       name        provider   state    directory
-----------------------------------------------------------------------------
c338b23  homestead-7 virtualbox poweroff C:/Users/ferrari/Homestead
10bc184  homestead   virtualbox running  C:/Users/ferrari/Homestead

The above shows information about all known Vagrant environments
on this machine. This data is cached and may not be completely
up-to-date (use "vagrant global-status --prune" to prune invalid
entries). To interact with any of the machines, you can go to that
directory and run Vagrant, or you can use the ID directly with
Vagrant commands from any directory. For example:
"vagrant destroy 1a2b3c4d"

@svpernova09
Copy link
Contributor

Ah hah! I believe we've found something. Looks like you didn't destroy the VM before you upgraded.

Run the following:

cd C:/Users/ferrari/Homestead
vagrant destroy

Open Virtualbox GUI, then destroy each VM and make sure you "delete all files"
Close virtualbox
Check your "Virtualbox VMs" folder (Probably in your user's Home folder" and make sure it's empty. If it's not empty go a head and delete everything in this folder.
Open the Virtualbox GUI and confirm there are no VMs.

Run:
vagrant global-status --prune, then vagrant global-status and verify no VMs show up.

Reboot your system.

Run (once more for good measure):
vagrant global-status --prune, then vagrant global-status and verify no VMs show up.

Now you should be good to run vagrant up

@ghost
Copy link
Author

ghost commented Jul 11, 2019

It didn't helped. I still get the errors from above.

@svpernova09
Copy link
Contributor

It didn't helped. I still get the errors from above.

Let's see another vagrant global-status

@ghost
Copy link
Author

ghost commented Jul 11, 2019

id       name      provider   state   directory
--------------------------------------------------------------------------
e2fdb7b  homestead virtualbox running C:/Users/ferrari/Homestead

@svpernova09
Copy link
Contributor

Windows 10 pro 1903
Virtualbox 6.0.8
Vagrant 2.2.5

Here's a full gist of Vagrant up and create project: https://gist.github.com/svpernova09/f1c9a619be368f29b6fc41d4de535441

Adding & removing barryvdh/laravel-ide-helper works fine

vagrant@homestead:~$ composer require --dev barryvdh/laravel-ide-helper
^C
vagrant@homestead:~$ cd blog/
vagrant@homestead:~/blog$ composer require --dev barryvdh/laravel-ide-helper
    1/2:        http://repo.packagist.org/p/provider-latest$db3743cf33b663e192063e326b662cb630df93ce4d84692a98697b864b48e042.json
    2/2:        http://repo.packagist.org/p/provider-2015$edb959bfa36ac9c7fd1ec1e4fde0e3914aa50951b79fd2cfdcaa360210130b31.json
    Finished: success: 2, skipped: 0, failure: 0, total: 2
Using version ^2.6 for barryvdh/laravel-ide-helper
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
    1/10:       https://codeload.github.com/Seldaek/phar-utils/legacy.zip/7009b5139491975ef6486545a39f3e6dad5ac30a
    2/10:       https://codeload.github.com/barryvdh/laravel-ide-helper/legacy.zip/39c148ad4273f5b8c49d0a363ddbc0462f1f2eec
    3/10:       https://codeload.github.com/composer/spdx-licenses/legacy.zip/a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d
    4/10:       https://codeload.github.com/composer/semver/legacy.zip/46d9139568ccb8d9e7cdd4539cab7347568a5e2e
    5/10:       https://codeload.github.com/Seldaek/jsonlint/legacy.zip/d15f59a67ff805a44c50ea0516d2341740f81a38
    6/10:       https://codeload.github.com/composer/xdebug-handler/legacy.zip/46867cbf8ca9fb8d60c506895449eb799db1184f
    7/10:       https://codeload.github.com/barryvdh/ReflectionDocBlock/legacy.zip/6b69015d83d3daf9004a71a89f26e27d27ef6a16
    8/10:       https://codeload.github.com/justinrainbow/json-schema/legacy.zip/dcb6e1006bb5fd1e392b4daa68932880f37550d4
    9/10:       https://codeload.github.com/composer/ca-bundle/legacy.zip/558f321c52faeb4828c03e7dc0cfe39a09e09a2d
    10/10:      https://codeload.github.com/composer/composer/legacy.zip/19b5f66a0e233eb944f134df34091fe1c5dfcc11
    Finished: success: 10, skipped: 0, failure: 0, total: 10
Package operations: 11 installs, 0 updates, 0 removals
  - Installing composer/xdebug-handler (1.3.3): Loading from cache
  - Installing composer/spdx-licenses (1.5.1): Loading from cache
  - Installing symfony/filesystem (v4.3.2): Loading from cache
  - Installing justinrainbow/json-schema (5.2.8): Loading from cache
  - Installing seld/phar-utils (1.0.1): Loading from cache
  - Installing seld/jsonlint (1.7.1): Loading from cache
  - Installing composer/semver (1.5.0): Loading from cache
  - Installing composer/ca-bundle (1.1.4): Loading from cache
  - Installing composer/composer (1.8.6): Loading from cache
  - Installing barryvdh/reflection-docblock (v2.0.6): Loading from cache
  - Installing barryvdh/laravel-ide-helper (v2.6.2): Loading from cache
barryvdh/reflection-docblock suggests installing dflydev/markdown (~1.0)
barryvdh/laravel-ide-helper suggests installing doctrine/dbal (Load information from the database about models for phpdocs (~2.3))
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: barryvdh/laravel-ide-helper
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
vagrant@homestead:~/blog$ composer remove --dev barryvdh/laravel-ide-helper
Dependency "laravel/framework" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "laravel/framework" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "laravel/framework" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 11 removals
  - Removing symfony/filesystem (v4.3.2)
  - Removing seld/phar-utils (1.0.1)
  - Removing seld/jsonlint (1.7.1)
  - Removing justinrainbow/json-schema (5.2.8)
  - Removing composer/xdebug-handler (1.3.3)
  - Removing composer/spdx-licenses (1.5.1)
  - Removing composer/semver (1.5.0)
  - Removing composer/composer (1.8.6)
  - Removing composer/ca-bundle (1.1.4)
  - Removing barryvdh/reflection-docblock (v2.0.6)
  - Removing barryvdh/laravel-ide-helper (v2.6.2)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
vagrant@homestead:~/blog$

Adding & removing doctrine/dbal works fine

vagrant@homestead:~/blog$ composer require --dev doctrine/dbal
    1/2:        http://repo.packagist.org/p/provider-latest$f40588e3c0806186c9026fae385c33c80b6f3137ec216f7163c83833e6c597fb.json
    2/2:        http://repo.packagist.org/p/provider-2018$fe6d28dd3da087fca8a5b811290ab532c1af5011029978f2278ff0f3c4b4cf99.json
    Finished: success: 2, skipped: 0, failure: 0, total: 2
Using version ^2.9 for doctrine/dbal
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
    1/3:        https://codeload.github.com/doctrine/cache/legacy.zip/d768d58baee9a4862ca783840eca1b9add7a7f57
    2/3:        https://codeload.github.com/doctrine/event-manager/legacy.zip/a520bc093a0170feeb6b14e9d83f3a14452e64b3
    3/3:        https://codeload.github.com/doctrine/dbal/legacy.zip/22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9
    Finished: success: 3, skipped: 0, failure: 0, total: 3
Package operations: 3 installs, 0 updates, 0 removals
  - Installing doctrine/event-manager (v1.0.0): Loading from cache
  - Installing doctrine/cache (v1.8.0): Loading from cache
  - Installing doctrine/dbal (v2.9.2): Loading from cache
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
vagrant@homestead:~/blog$ composer remove --dev doctrine/dbal
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 3 removals
  - Removing doctrine/event-manager (v1.0.0)
  - Removing doctrine/dbal (v2.9.2)
  - Removing doctrine/cache (v1.8.0)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
vagrant@homestead:~/blog$

I'm not able to reproduce the issue, so there's nothing I can do here. It sounds like you're running vagrant commands as a different user than who owns the files you're mapping which will cause these problems. You should be running these commands as user ferrari (based on your path) and not in an elevated prompt (Run as Admin).

@ghost
Copy link
Author

ghost commented Jul 11, 2019

I have to run homestead in git as an admin, because I use yarn. As an Windows 10 user I would have other issues if I would use npm.

@BarryJamez BarryJamez mentioned this issue Apr 6, 2020
@aminazirani aminazirani mentioned this issue Dec 22, 2020
@gafuro gafuro mentioned this issue Jan 14, 2021
Closed
@siebird siebird mentioned this issue Aug 30, 2021
Closed
@BlueBear1996 BlueBear1996 mentioned this issue May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant