1、执行 yarn 命令时,报错:The engine “node” is incompatible with this module.Expected version “^14.18.0 || ^16.14.0 || >=18.0.0”. Got “16.13.1”。如图1

图1

PS E:\wwwroot\shopify-app>yarn create @shopify/app
yarn create v1.22.15
[1/4] Resolving packages...
[2/4] Fetching packages...
error execa@7.2.0: The engine "node" is incompatible with this module. Expected version "^14.18.0 || ^16.14.0 || >=18.0.0". Got "16.13.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

2、^16.14.0相当于>=16.14.0,<16.15,决定重新安装 Node.js 的 16 的最新版本。打开网址:https://nodejs.org/dist/latest-v16.x/ 计划下载 node-v16.20.2-x64.msi 。但是,发现其不符合版本依赖的要求。如图2

图2

 

3、>=18.0.0 也是可行的,最张决定下载 18 的最新版本。下载 node-v18.18.0-x64.msi。再次执行 yarn 命令时,不再报错。如图3

图3

PS E:\wwwroot\shopify-app> node -v
v18.18.0
PS E:\wwwroot\shopify-app> yarn create @shopify/app
yarn create v1.22.15
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "@shopify/create-app > @oclif/core > ts-node@10.9.1" has unmet peer dependency "@types/node@*".
warning "@shopify/create-app > @oclif/core > ts-node@10.9.1" has unmet peer dependency "typescript@>=2.7".
[4/4] Building fresh packages...
success Installed "@shopify/create-app@3.49.3" with binaries:
      - create-app

Welcome. Let’s get started by naming your app project. You can change it later.

?  Your project name?
>  fruitful-shareholder-app
   ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
永夜