Coder Social home page Coder Social logo

Comments (7)

milaninfy avatar milaninfy commented on August 15, 2024 1

For me it's showing correct version

~ $ npx [email protected] --version
8.4.0
~ $ npm ls -g 
/Users/testing/.nvm/versions/node/v22.0.0/lib
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

from cli.

mshima avatar mshima commented on August 15, 2024
% npx -v
10.7.0
% npx [email protected] --version
8.3.0
% npm ls -g
/opt/homebrew/lib
.
├── [email protected]
.

Anything else I could do to debug?

from cli.

milaninfy avatar milaninfy commented on August 15, 2024

does you cwd has that package installed ?
what does npm ls shows from where you are running the command ?

from cli.

mshima avatar mshima commented on August 15, 2024

does you cwd has that package installed ? what does npm ls shows from where you are running the command ?

It's an empty folder.

% npm ls
/Users/mshima/git/test
└── (empty)

from cli.

mshima avatar mshima commented on August 15, 2024

@milaninfy I think a found a way to reproduce:

npm install -g [email protected] generator-jhipster-native@latest
% npx [email protected] --version
8.3.0

If I remove every global package and install the generator-jhipster, it works.
Then if I install generator-jhipster-native that have [email protected] as a dependency, the problem is reproducible.

from cli.

mshima avatar mshima commented on August 15, 2024

I've added a console.log in /usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:

      // package requested by specific version
      if (spec.type === 'version' && (node.pkgid === spec.raw)) {
        console.log(node)
        return { node }

It prints:

% npx [email protected] --version
⠦ArboristNode {
  name: 'generator-jhipster',
  version: '8.4.0',
  location: 'node_modules/generator-jhipster-native/node_modules/generator-jhipster',
  path: '/usr/local/lib/node_modules/generator-jhipster-native/node_modules/generator-jhipster',
.
.
.
8.3.0

generator-jhipster inside generator-jhipster-native is found. But the root (8.3.0) is used.

from cli.

wraithgar avatar wraithgar commented on August 15, 2024

Duplicated in a workspace off of latest

@wraithgar ➜ /workspaces/cli (latest) $ npx [email protected] --version
8.3.0
@wraithgar ➜ /workspaces/cli (latest) $ npm ls -g
/usr/local/share/nvm/versions/node/v20.12.1/lib
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.