簡體   English   中英

無法使用 NPM 安裝 BigCommerce Stencil CLI

[英]Unable to install BigCommerce Stencil CLI with NPM

我正在嘗試使用 NPM 安裝 BigCommerce Stencil CLI。我按照bigcommerce網站上的說明進行操作,但是當我嘗試安裝 Stencil CLI 時出現錯誤。

我沒有使用 NPM 的經驗,我只想將 style.css 文件添加到 bigcommerce 主題,他們強迫您使用 NPM。顯然它不適合我。 在我腦海中的聲音獲勝之前,任何人都可以幫助我,我將筆記本電腦放入洗碗機中。

NPM 版本:

{
  npm: '8.10.0',
  node: '14.19.3',
  v8: '8.4.371.23-node.87',
  uv: '1.42.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '83',
  nghttp2: '1.42.0',
  napi: '8',
  llhttp: '2.1.4',
  openssl: '1.1.1o',
  cldr: '40.0',
  icu: '70.1',
  tz: '2021a3',
  unicode: '14.0'
}

從嘗試的 stencil-cli 安裝中記錄:


michaelcalland@Michaels-MBP-2 ~ % npm install -g @bigcommerce/stencil-cli  
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /Users/michaelcalland/.nvm/versions/node/v14.19.3/bin/node /Users/michaelcalland/.nvm/versions/node/v14.19.3/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/michaelcalland/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/michaelcalland/.npm/_cacache/tmp/git-clonemTrJwq
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node scripts/install.js
npm ERR! npm ERR! internal/modules/cjs/loader.js:905
npm ERR! npm ERR!   throw err;
npm ERR! npm ERR!   ^
npm ERR! npm ERR! 
npm ERR! npm ERR! Error: Cannot find module 'npmconf'
npm ERR! npm ERR! Require stack:
npm ERR! npm ERR! - /Users/michaelcalland/.npm/_cacache/tmp/git-clonemTrJwq/scripts/install.js
npm ERR! npm ERR!     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
npm ERR! npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
npm ERR! npm ERR!     at Module.require (internal/modules/cjs/loader.js:974:19)
npm ERR! npm ERR!     at require (internal/modules/cjs/helpers.js:101:18)
npm ERR! npm ERR!     at Object.<anonymous> (/Users/michaelcalland/.npm/_cacache/tmp/git-clonemTrJwq/scripts/install.js:8:15)
npm ERR! npm ERR!     at Module._compile (internal/modules/cjs/loader.js:1085:14)
npm ERR! npm ERR!     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
npm ERR! npm ERR!     at Module.load (internal/modules/cjs/loader.js:950:32)
npm ERR! npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
npm ERR! npm ERR!     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {
npm ERR! npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR! npm ERR!   requireStack: [
npm ERR! npm ERR!     '/Users/michaelcalland/.npm/_cacache/tmp/git-clonemTrJwq/scripts/install.js'
npm ERR! npm ERR!   ]
npm ERR! npm ERR! }
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /Users/michaelcalland/.npm/_logs/2022-05-23T15_04_52_632Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/michaelcalland/.npm/_logs/2022-05-23T15_04_48_251Z-debug-0.log

我試過卸載/安裝 npm 但我真的不明白該怎么做。

我按照文檔中的建議使用 Node v14.20 在 Mac 上解決了這個問題,但是從 NPM v7 切換到 NPM v6,文檔中沒有提到這一點。

假設您安裝了 NVM,我執行了以下操作:

nvm install 14.20
nvm use 14.20
npm install -g npm@6.14.17 (or the last v6)
npm install -g @bigcommerce/stencil-cli

現在安裝成功。

我也遇到了同樣的問題,但發現了這個 您只需使用節點版本 14.20.0。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM