CMS Development

jasoncampbelldv
Participant

Cheat sheet and error fixes for building theme files locally.

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

2 Replies 2
Jnix284
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

Cheat sheet and error fixes for building theme files locally.

Awesome, thanks for sharing @jasoncampbelldv - I also ran into these errors when I switched from PC to Mac and didn't take the time to resolve them, looking forward to setting up the CLI again to see if I can get it working on my Mac.

 


If my reply answered your question please mark it as a solution to make it easier for others to find.



Jennifer Nixon - Director of Revenue Operations at WORQFLOW

connect with Jen on Linkedin

jasoncampbelldv
Participant

Cheat sheet and error fixes for building theme files locally.

Happy to help! Let me know if you have any questions.