NodeJS Windows PC上Bigcommerce主题目录中的“npm install”错误故障排除

ny6fqffe  于 2023-08-04  发布在  Node.js
关注(0)|答案(1)|浏览(94)

系统信息:

  • Node.js版本:20.5.0
  • npm版本:9.8.1
  • 巧克力版本:2.2.0
  • Git版本:2.41.0.windows.3
    **遇到的问题:**当尝试在我的Windows PC上运行Bigcommerce主题目录(C:\Website\Stencil for website\Fortune+31072023-2.8.0)中的“npm install”时,我遇到了以下错误:
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command C:\Program Files\Git\bin\git.exe --no-replace-objects clone -b v3.5.0 ssh://git@github.com/bigcommerce-labs/node-sass.git C:\Users\saman\AppData\Roaming\npm-cache\_cacache\tmp\git-clonerVR5QJ --recurse-submodules --depth=1 --config core.longpaths=true
npm ERR! fatal: destination path 'C:\Users\saman\AppData\Roaming\npm-cache\_cacache\tmp\git-clonerVR5QJ' already exists and is not an empty directory.

字符串

故障排除步骤:

  • 尝试了不同版本的Node.js。
  • 已重新启动所有安装步骤。
  • 删除所有与Node.js相关的路径变量并重新安装。
  • 已检查Git配置(用户名和电子邮件)。
  • 已使用“npm cache clean --force”清除npm缓存。
  • 使用“npm config set node-sass:git https://github.com/bigcommerce-labs/node-sass.git."”将node-sass的远程URL设置为HTTPS
  • 使用“npm install -g npm”全局更新了npm。
  • 已手动验证并删除假定的缓存目录(“C:\Users\saman\AppData\Roaming\npm-cache_cacache\tmp”)。
    附加信息:

使用Windows操作系统。目录“C:\Users\saman\AppData\Roaming\npm-cache_cacache\tmp”为空,并且以前从未存在过。目标是在Bigcommerce主题目录中成功执行“npm install”,以使用Stencil-CLI并编辑主题。

摘要:

如何解决我在Windows PC上的Bigcommerce主题目录中尝试执行命令时在“npm install”期间遇到的错误?错误中提到的指定目标路径(“C:\Users\saman\AppData\Roaming\npm-cache_cacache\tmp”)为空。我已尝试了几个故障排除步骤,但问题仍然存在。我的目标是使用Stencil-CLI并编辑我的Bigcommerce主题。如何成功执行“npm install”?

日志:

6377 timing idealTree Completed in 64623ms
6378 timing command:install Completed in 64627ms
6379 verbose stack Error: An unknown git error occurred
6379 verbose stack     at makeError (C:\Users\saman\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\git\lib\make-error.js:28:13)
6379 verbose stack     at C:\Users\saman\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\git\lib\spawn.js:37:26
6379 verbose stack     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
6379 verbose stack     at async C:\Users\saman\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\git.js:268:19
6379 verbose stack     at async withTempDir (C:\Users\saman\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\fs\lib\with-temp-dir.js:21:14)
6379 verbose stack     at async Promise.all (index 3)
6379 verbose stack     at async #buildDepStep (C:\Users\saman\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1034:5)
6379 verbose stack     at async Arborist.buildIdealTree (C:\Users\saman\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:196:7)
6379 verbose stack     at async Promise.all (index 1)
6379 verbose stack     at async Arborist.reify (C:\Users\saman\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:159:5)
6380 verbose cwd C:\Website\Stencil for website\Fortune+31072023-2.8.0
6381 verbose Windows_NT 10.0.22621
6382 verbose node v20.5.0
6383 verbose npm  v9.8.1
6384 error code 128
6385 error An unknown git error occurred
6386 error command C:\Program Files\Git\bin\git.exe --no-replace-objects clone -b v3.5.0 ssh://git@github.com/bigcommerce-labs/node-sass.git C:\Users\saman\AppData\Roaming\npm-cache\_cacache\tmp\git-clonerVR5QJ --recurse-submodules --depth=1 --config core.longpaths=true
6387 error fatal: destination path 'C:\Users\saman\AppData\Roaming\npm-cache\_cacache\tmp\git-clonerVR5QJ' already exists and is not an empty directory.
6388 verbose exit 128
6389 timing npm Completed in 64795ms
6390 verbose unfinished npm timer reify 1690972639361
6391 verbose unfinished npm timer reify:loadTrees 1690972639363
6392 verbose code 128

ozxc1zmp

ozxc1zmp1#

我在MacBook上也遇到了同样的错误,但是升级这些软件包解决了这个问题。
来自:

"@bigcommerce/stencil-utils": "^5.0.3"
"@bigcommerce/stencil-cli": "^2.1.1"

字符串

"@bigcommerce/stencil-utils": "^6.15.1"
"@bigcommerce/stencil-cli": "^7.2.0"

相关问题