問題1:
依存モジュールをダウンロードするために "npm install "コマンドを実行すると、以下のようなエラーが発生することがあります:
npm ERR! notarget No matching version found for @speak/ng-bcl@~0.8.0 npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist. npm ERR! notarget npm ERR! notarget It was specified as a dependency of '@sitecore/bizfx-sdk'
npm ERR! notarget No matching version found for @speak/styling@0.9.0-r00078 npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist. npm ERR! notarget npm ERR! notarget It was specified as a dependency of '@sitecore/bizfx-sdk'
原因: SPEAKパッケージは、SitecoreのパブリックNugetフィードからは利用できません。Experience Commerce 9 のリリースパッケージからのみ利用可能です。
問題 2:
Experience Commerce 9.0 Initial Release から BizFX SDK を使用している場合、「ng serve」「ng build」コマンドを実行すると、以下のようなエラーが発生する場合があります:
ERROR in C:/bizfxSDK/src/app/components/actions/sc-bizfx-action.component.ts (116,26): Supplied parameters do not match any signature of call target. ERROR in C:/bizfxSDK/src/app/components/actions/sc-bizfx-actiongrid.component.ts (61,32): Supplied parameters do not match any signature of call target. ERROR in C:/bizfxSDK/src/app/components/actions/sc-bizfx-action.component.ts (116,26): Supplied parameters do not match any signature of call target. ERROR in C:/bizfxSDK/src/app/components/actions/sc-bizfx-actiongrid.component.ts (61,32): Supplied parameters do not match any signature of call target.
原因: BizFX SDKのバージョンとSitecore public Nugetフィードにあるbizfxパッケージのバージョンが一致している必要があります。そうでない場合、上記のような非互換性の問題が発生する可能性があります。
Sitecore Experience Commerce Initial Release および Update-1 用の BizFX SDK パッケージに含まれる README.md の内容には、古い情報が含まれています。BizFX SDKをビルドし、記載されている問題を修正するためには、以下の正しい手順で作業を行ってください:
# Sitecore Commerce Business Tools SDK # Setup 開発を開始する前に、ユーザーのnpm構成にSitecoreフィードがあることを確認してください。 C:\Users\[your user]\.npmrc に移動して、以下の行を追加してください: @speak:registry=https://sitecore.myget.org/F/sc-npm-packages/npm/ @sitecore:registry=https://sitecore.myget.org/F/sc-npm-packages/npm/ ファイルが存在しない場合は、以下を実行してください: npm config set @speak:registry=https://sitecore.myget.org/F/sc-npm-packages/npm/ npm config set @sitecore:registry=https://sitecore.myget.org/F/sc-npm-packages/npm/ SPEAKとBizFxのパッケージをインストールし、実行します: npm install speak-ng-blc-0.8.0.tgz npm install speak-styling-0.9.0-r00078.tgz XC9 Initial Release用: npm install @sitecore/bizfx 1.0.572 XC9 Update1用:
npm install @sitecore/bizfx 1.1.9 SPEAK tarballファイルは、Sitecore.Commerce.[version].zip ファイルのルートにあります。 npm installを実行します。 ## 開発サーバー 開発サーバーに対してng serveを実行します。http://localhost:4200/ に移動します。 ソース ファイルのいずれかを変更すると、アプリは自動的にリロードされます。 ## コード スキャフォールディング ng generate component component-nameを実行して、新しいコンポーネントを生成します。 ng generate directive|pipe|service|class|guard|interface|enum|moduleを使用することもできます。
## ビルド ng build を実行してプロジェクトをビルドします。 ビルド アーティファクトはdist/ディレクトリに保存されます。 本番ビルドには-prodフラグを使用します。
## ユニット テストの実行
ng test で Karma 経由でユニット テストを実行します。 ## エンドツーエンド テストの実行 ng e2e を実行し、Protractor を介してエンドツーエンド テストを実行します。 ## より詳細なヘルプ Angular CLIに関するより詳細なヘルプを確認する場合はng helpを使うか、Angular CLI READMEを確認してください。