PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 21, 2022

[FIXED] Composer uses old package version

 January 21, 2022     composer-php, package, php     No comments   

Issue

I have a custom package injected into my project via composer.json, this package is currently on version 2.0.1 I changed something in the source code of the package and set the version in the package.json to 2.0.2 pushed it to git and tried to update my composer but every time I get

      - Installing myproject/laravel-jssettings (v2.0.1): Cloning 9663e29ee0 from cache

even tho I cleared the composer cache and deleted the composer.lock file

The line in my composer.json file is

    "myproject/laravel-jssettings": "~2.0",

I tried to set it to

    "myproject/laravel-jssettings": "2.0.2", 

but then i get an error message which says

      Problem 1
- The requested package myproject/laravel-jssettings 2.0.2 exists as myproject/laravel-jssettings[v2.0.0, v2.0.1] but these are rejected by your constraint.

what do i miss here, where do i have to clear the cache or change to a new version so that the composer gets the new 2.0.2 version. thx in advance


Solution

You need to craete a tag for your custom repository. After that tag will be pushed to repositroy composer will get lates updates.

git tag 2.0.2
git push origin --tags

and after that try to composer update on your project. Composer documentation



Answered By - Alex Matvieiev
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing