Current Behavior:
npm init <pkg> always runs whatever version of the <pkg> is installed and doesn't check whether
there's a later version. Moreover, there is no way to tell it to do that.
Expected Behavior:
npm init <pkg> should first check if there's an updated version of <pkg> and install that before running it.
Alternatively, there should be an option (--update?) that updates to the latest version before running it.
Steps To Reproduce:
- Publish
@scope/create (v1.0.0)
- Run
npm init @scope. It runs v1.0.0 as expected (which is OK).
- Publish a new
@scope/create (v1.1.0)
- Run
npm init @scope. It still runs v1.0.0 and there is no way to make it run v1.1.0.
- The workaround I have is to
npm exec @scope/create@latest, which does the right thing.
- Even doing
npm install -g @scope/create@latest doesn't help
Environment:
I'm guessing all versions, but specifically what I'm running on is:
OS: MacOS Big Sur
Node.js: 15.3.0.
NPM: 7.0.14
Current Behavior:
npm init <pkg>always runs whatever version of the<pkg>is installed and doesn't check whetherthere's a later version. Moreover, there is no way to tell it to do that.
Expected Behavior:
npm init <pkg>should first check if there's an updated version of<pkg>and install that before running it.Alternatively, there should be an option (
--update?) that updates to the latest version before running it.Steps To Reproduce:
@scope/create(v1.0.0)npm init @scope. It runs v1.0.0 as expected (which is OK).@scope/create(v1.1.0)npm init @scope. It still runs v1.0.0 and there is no way to make it run v1.1.0.npm exec @scope/create@latest, which does the right thing.npm install -g @scope/create@latestdoesn't helpEnvironment:
I'm guessing all versions, but specifically what I'm running on is:
OS: MacOS Big Sur
Node.js: 15.3.0.
NPM: 7.0.14