Hydrogen - npm create @shopify/hydrogen@latest - throwing errors immediately

dtabibzadeh
Visitor
2 0 0

Hello,

 

I'm currently stuck on "step 1" of trying to create a new Hydrogen (React) project (via CLI). Following what it says to do right on the homepage -- Hydrogen: Shopify’s headless commerce framework -- npm create @Shopify/hydrogen@latest -- isn't working. I've attached my error log below (screenshot + text).

I have "shopify-cli" and "ThemeKit" installed. What am I missing here? The error it gives is ambiguous, as it is not the correct error. I am not running this command "non interactively." I'm running this command from Git Bash / cmd prompt. 

Any help would be much appreciated! About to embark on a long journey -- converting a "legacy" Shopify site (which heavily utilizes jQuery) to Hydrogen (NextJS/React). Excited, but, getting stuck on step 1 sucks!!

In case relevant, I do have another shopify project on my machine. But, I don't think that should matter... as I am going to utilize Mock.shop for data while I'm massaging the components to more closely match our design. I don't need to connect to my actual Shopify instance. Just looking to work with Hydrogen/NextJS and learn its nuances -- without necessarily connecting to our actual Shopify (which should be doable, as "Use sample data from Mock.shop" is the second prompt after running the npm command)


shopify help.png

 

DTabibzadeh@DTabibzadeh2023 MINGW64 ~
$ npx @shopify/create-hydrogen@latest
file:///C:/Users/dtabibzadeh/AppData/Local/npm-cache/_npx/e1eac94ad41cc36f/node_modules/@shopify/cli-kit/dist/public/node/ui.js:506
throw new AbortError(errorMessage, 'To resolve this, specify the option in the command, or run the command in an interactive environment such as your local terminal.');
^

AbortError: Failed to prompt:

Connect to Shopify

This usually happens when running a command non-interactively, for example in a CI environment, or when piping input from another process.
at throwInNonTTY (file:///C:/Users/dtabibzadeh/AppData/Local/npm-cache/_npx/e1eac94ad41cc36f/node_modules/@shopify/cli-kit/dist/public/node/ui.js:506:11)
at renderSelectPrompt (file:///C:/Users/dtabibzadeh/AppData/Local/npm-cache/_npx/e1eac94ad41cc36f/node_modules/@shopify/cli-kit/dist/public/node/ui.js:241:5)
at setupLocalStarterTemplate (file:///C:/Users/dtabibzadeh/AppData/Local/npm-cache/_npx/e1eac94ad41cc36f/node_modules/@shopify/cli-hydrogen/dist/lib/onboarding/local.js:17:60)
at runInit (file:///C:/Users/dtabibzadeh/AppData/Local/npm-cache/_npx/e1eac94ad41cc36f/node_modules/@shopify/cli-hydrogen/dist/commands/hydrogen/init.js:91:86)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
tryMessage: 'To resolve this, specify the option in the command, or run the command in an interactive environment such as your local terminal.',
type: 0,
nextSteps: undefined,
customSections: undefined
}

Node.js v18.17.1

 

Replies 2 (2)

dtabibzadeh
Visitor
2 0 0

Alright. Sorry to post on my own thread, but I "found a solution" in case anyone runs into the same issue.

Not sure why I didn't try this sooner (I guess because there isn't much logic to this), but, command prompt works whilst Git Bash doesn't ¯\_(ツ)_/¯ (would like to know why though...)

 

dtabibzadeh_0-1697238238275.png

 

shadarck
Shopify Partner
1 0 0

Git Bash serves as a terminal environment primarily for Windows systems, providing a Unix-like command-line experience. While it runs on the operating system level, it's more accurate to describe it as a software application that integrates into the Windows environment. Regarding network requests, Git Bash doesn't inherently block commands attached to requests or the CLI. However, issues such as timeouts may occur due to various factors like network configuration, firewall settings, or compatibility issues. These issues may not necessarily be directly caused by Git Bash itself but could be related to how the system environment is configured or how the network is set up. It's essential to troubleshoot specific issues to determine their root cause accurately, as they might not solely stem from Git Bash. And something like powershell or cmd would be a better pick or if you are looking to have the feel of Linux I'd recommend using WSL