从 CLI 初始化 Shopify 应用程序时出现错误 - npm init @shopify/app@latest

问题描述 投票:0回答:1

尝试使用命令初始化 Shopify 应用程序时出现错误

npm init @shopify/app@latest

出现以下错误

  • npm init @shopify/app@latest

(node:80742) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)

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

?  Your project name?
✔  sustainable-supply-app

?  Get started building your app:
✔  Start with Remix (recommended)

?  For your Remix template, which language do you want?
✔  JavaScript


── external error ─────────────────────────────────────────────────────────────────────────────────────────────

Error coming from `npm install`

Command failed with exit code 1: npm install
(node:80870) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate
verification.
(Use `node --trace-warnings ...` to show where the warning was created)
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer
maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer
maintained. Please use @babel/plugin-transform-object-rest-spread instead.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     '/private/var/folders/25/4j3t9s7n6xx_t3qftrctv6200000gq/T/4918339d29357aa8a757c14cbe37a34a/app/node_modules/@shopify',
npm WARN cleanup     [Error: EINVAL: invalid argument, rmdir
'/private/var/folders/25/4j3t9s7n6xx_t3qftrctv6200000gq/T/4918339d29357aa8a757c14cbe37a34a/app/node_modules/@shopify/app/node_modules/@shopify/polaris'] {
npm WARN cleanup       errno: -22,
npm WARN cleanup       code: 'EINVAL',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path:
'/private/var/folders/25/4j3t9s7n6xx_t3qftrctv6200000gq/T/4918339d29357aa8a757c14cbe37a34a/app/node_modules/@shopify/app/node_modules/@shopify/polaris'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path /private/var/folders/25/4j3t9s7n6xx_t3qftrctv6200000gq/T/4918339d29357aa8a757c14cbe37a34a/app/node_modules/@parcel/watcher
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.13 found at "/Users/vimal.negi/miniconda3/bin/python3"
npm ERR! gyp info spawn /Users/vimal.negi/miniconda3/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/vimal.negi/.nvm/versions/node/v18.19.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args
'/private/var/folders/25/4j3t9s7n6xx_t3qftrctv6200000gq/T/4918339d29357aa8a757c14cbe37a34a/app/node_modules/@parcel/watcher/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/vimal.negi/.nvm/versions/node/v18.19.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/vimal.negi/Library/Caches/node-gyp/18.19.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/Users/vimal.negi/Library/Caches/node-gyp/18.19.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/vimal.negi/.nvm/versions/node/v18.19.0/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/vimal.negi/Library/Caches/node-gyp/18.19.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args
'-Dmodule_root_dir=/private/var/folders/25/4j3t9s7n6xx_t3qftrctv6200000gq/T/4918339d29357aa8a757c14cbe37a34a/app/node_modules/@parcel/watcher',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: binding.gyp not found (cwd: /private/var/folders/25/4j3t9s7n6xx_t3qftrctv6200000gq/T/4918339d29357aa8a757c14cbe37a34a/app/node_modules/@parcel/watcher)
while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/Users/vimal.negi/.nvm/versions/node/v18.19.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:271:18)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:292:12)
npm ERR! gyp ERR! System Darwin 22.5.0
npm ERR! gyp ERR! command "/Users/vimal.negi/.nvm/versions/node/v18.19.0/bin/node"
"/Users/vimal.negi/.nvm/versions/node/v18.19.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /private/var/folders/25/4j3t9s7n6xx_t3qftrctv6200000gq/T/4918339d29357aa8a757c14cbe37a34a/app/node_modules/@parcel/watcher
npm ERR! gyp ERR! node -v v18.19.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /Users/vimal.negi/.npm/_logs/2024-02-08T05_58_35_264Z-debug-0.log

───────────────────────────────────────────────────────────────────────────────────────────────────────────────

npm ERR! code 1
npm ERR! path /Users/vimal.negi/Documents/cmp/sdk
npm ERR! command failed
npm ERR! command sh -c create-app

npm ERR! A complete log of this run can be found in: /Users/vimal.negi/.npm/_logs/2024-02-08T05_58_27_990Z-debug-0.log

以下是版本

(基础)➜~节点-v

v18.19.0

(基础)➜ ~ npm -v

10.4.0

(基础)➜〜python --version

Python 3.9.18

我尝试过在其中一个线程中提到的忽略脚本,但似乎不起作用

尝试创建shopify插件

node.js npm shopify node-gyp
1个回答
0
投票

您在尝试使用

npm init @shopify/app@latest
命令初始化 Shopify 应用时似乎遇到了错误。此命令用于使用 Shopify CLI 构建新的 Shopify 应用项目。

您可以尝试以下一些故障排除步骤来解决问题:

更新 npm: 确保您的 npm 版本是最新的。您当前使用的是 npm 版本 10.4.0,该版本相当旧。您可以通过运行更新 npm:

npm install -g npm@latest

重试初始化: 更新 npm 后,尝试再次运行初始化命令:

npm init @shopify/app@latest

检查互联网连接: 确保您有稳定的互联网连接。有时网络问题可能会导致软件包安装过程中出现错误。

清除 npm 缓存: 清除 npm 缓存可能会解决任何潜在的缓存问题:

npm cache clean --force

使用节点版本管理器 (NVM): 考虑使用像 nvm 这样的节点版本管理器来管理 Node.js 版本。这有助于确保项目之间的兼容性和一致性。

检查代理设置: 如果您使用代理,请确保您的 npm 配置正确设置为使用代理。您可能需要通过设置 http_proxy 和 https_proxy 环境变量来配置 npm 以使用代理。

如果上述步骤均无法解决问题,请提供有关您遇到的具体错误消息的更多详细信息。错误消息应该可以更深入地了解问题的根本原因,这有助于进一步排除故障。

© www.soinside.com 2019 - 2024. All rights reserved.