I did the HubSpot CMS Best Practices for Developers training and wanted to share my notes incase they are useful to anyone else…
Commands/steps to install
Install hubspot tools and node_modules:
npm install @hubspot/cli
Create yml config file:
npx hs init
Create theme:
npx @hubspot/create-cms-project test-theme
Create template:
npx hs create template templates/basic-page
Upload theme:
npx hs upload test-theme/src test-theme
Watch for updates automatically:
npx hs watch test-theme/src test-theme
Error Fixes
Error: Cannot find module ‘node:path’
Fix: Update node
sudo npm cache clean -f (force) clear your npm cache
sudo npm install -g n install n (this might take a while)
sudo n stable upgrade to the current stable version
Error: yarn not found
Fix: install yarn
npm install --global yarn
Error: xcrun: error: invalid active developer path
Fix: install xcode
xcode-select --install