[BUG] npm init <package>
doesn't use newer version if existing version is semver-major incompatible
#3444
Labels
Bug
thing that needs fixing
Priority 2
secondary priority issue
Release 7.x
work is associated with a specific npm 7 release
Is there an existing issue for this?
Current Behavior
(the use of
@roundforest
is just an example.)Using
npm init @scope
will use the latest version of the package, but only if the latest version is semver-minor/patch compatible with the version last used innm init @scope
. If it is semver-major changed, then it will continue to use the older version.Expected Behavior
Always use the latest version of the init package, even if the semver-major version of the package is larger.
Steps To Reproduce
npm init @roundforest
to run the@roundforest/create
, which is currently at version1.0.0
. Works!@roundforest/create
, version1.1.0
.npm init @roundforest
to run the@roundforest/create
. It will ask to usev1.1.0
, and uses it. Yay!@roundforest/create
, version2.0.0
(semver incompatible with1.1.0
.npm init @roundforest
to run the@roundforest/create
. It will NOT use version2.0.0
, even though I expect it to.npx
cache ofnpm init
, and trynpm init @roundforest
again, it will use version2.0.0
Environment
The text was updated successfully, but these errors were encountered: