Skip to content

[BUG] npx isn't using latest version of package #4108

Closed
@Tobbe

Description

@Tobbe

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

npx is running an old version of a script

I've checked to make sure it's not installed (globally or locally)

$ npm ls
rw@ /Users/tobbe/dev/redwood/rw
├── @redwoodjs/core@0.39.2
├─┬ api@0.0.0 -> ./api
│ ├── @paypal/checkout-server-sdk@1.0.3
│ ├── @redwoodjs/api@0.39.2
│ ├── @redwoodjs/graphql-server@0.39.2
│ ├── aws-sdk@2.995.0
│ ├── node-fetch@2.6.6
│ └── pino-logflare@0.3.12
└─┬ web@0.0.0 -> ./web
  ├── @emotion-icons/boxicons-logos@2.10.0
  ├── @emotion-icons/boxicons-regular@2.10.0
  ├── @react-google-maps/api@2.4.1
  ├── @redwoodjs/auth@0.39.2
  ├── @redwoodjs/forms@0.39.2
  ├── @redwoodjs/router@0.39.2
  ├── @redwoodjs/web@0.39.2
  ├── @sentry/react@6.13.3
  ├── @sentry/tracing@6.13.3
  ├── babel-plugin-add-react-displayname@0.0.5
  ├── graphql-hooks@5.4.0
  ├── graphql-request@3.5.0
  ├── logrocket-react@4.0.1
  ├── logrocket@2.1.1
  ├── lunr@2.3.9
  ├── minisearch@3.1.0
  ├── prop-types@15.7.2
  ├── react-dom@17.0.2
  ├── react-query@3.24.4
  ├── react-responsive-carousel@3.2.21
  ├── react-slim-image-viewer@0.2.0
  ├── react@17.0.2
  ├── string-strip-html@9.0.4
  └── theme-ui@0.8.4
$ npm list -g --depth 0
/opt/homebrew/lib
└── npm@8.1.4
$ npx @redwoodjs/codemods --version
Need to install the following packages:
  @redwoodjs/codemods
Ok to proceed? (y) y
0.38.3

$ npx @redwoodjs/codemods@latest --version
0.39.2

This issue is very similar #2329 but it's closed. So either this problem has come back again, or it wasn't truly fixed in the first place.

Expected Behavior

As long as the given package is not installed, I expect npx to always use the latest version

Steps To Reproduce

It's always reproducible with the steps given above in "Current Behavior", but I don't yet know if it's reproducible with any package, or just @redwoodjs/codemods

Environment

  • npm: 8.1.4
  • Node: 16.12.0
  • OS: MacOS 11.6
  • platform: M1
  • npm config:
; "builtin" config from /opt/homebrew/lib/node_modules/npm/npmrc

prefix = "/opt/homebrew"

; "user" config from /Users/tobbe/.npmrc

//registry.npmjs.org/:_authToken = (protected)

; node bin location = /opt/homebrew/Cellar/node/16.12.0/bin/node
; cwd = /Users/tobbe/dev/redwood/rw
; HOME = /Users/tobbe
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions