Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npx create-webiny-project does not recognize npm version correctly #4213

Open
LeoDeJaneiro opened this issue Jul 31, 2024 · 3 comments
Open
Labels

Comments

@LeoDeJaneiro
Copy link

Version

Operating System

MacOs 13.6.7 (22G720)

Browser

What are the steps to reproduce this bug?

Installation of NodeJs v20.11.1 via asdf

$ node --version
v20.11.1
$ which npm
/Users/.../.asdf/shims/npm
$ npm --version
10.8.2
$ npx --version
10.8.2
$ npx create-webiny-project webiny-fresh
Webiny requires npm@^10 or higher.
Please run npm install npm@latest -g, to get the latest version.

What is the expected behavior?

Should be possible to bootstrap project with NPM 10.8.2 according to printed requirement.

What do you see instead?

Webiny requires npm@^10 or higher.
Please run npm install npm@latest -g, to get the latest version.

Additional information

No response

Possible solution

No response

@thirdender
Copy link

I'm having the same issue with npm 10.9.0 (with Node v20.18.0 on Ubuntu)

@thirdender
Copy link

🔨 I found a workaround, I was able to run yarn create webiny-project headless instead.

It looks like npm --version (https://github.com/webiny/webiny-js/blob/5e0b6cbd8291624b27323a4d2ed679732c5948e4/packages/create-webiny-project/utils/getNpmVersion.js#L5C9-L5C62) returns nothing when run by execa on my system. Did something change with npm recently, or is this related to how I have npm installed on my system? Running npm --version from the command line returns the expected value.

{
  command: 'npm --version',
  stdout: '',
  stderr: '',
  stdio: [ undefined, '', '' ],
  ipcOutput: [],
  pipedFrom: []
}

@Pavel910
Copy link
Collaborator

This is a very weird issue. I'm able to create projects without problems using npm 10.8.1 and node 20.16.0. This is how we detect npm version: https://github.com/webiny/webiny-js/blob/next/packages/create-webiny-project/utils/getNpmVersion.js

There really isn't anything complex about the version detection, it's just running npm --version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants