CMS Development

DirtyBirdDesign
Teilnehmer/-in

CMS CLI installation issues

lösung

Installation should be simple, as it is very straightforward. Im sure Im overlooking something obvious, would appreciate any help from others who have encountered the same.

  1. I have NPM installed
    Screenshot 2020-07-21 12.06.06.png
  2. I try and install using npm install -g @hubspot/cms-cliScreenshot 2020-07-21 10.49.09.png I used the global flag in my /usr/local/bin/ directory.
  3. Using hs init returns "zsh: command not found: hs"
  4. Using npm list it shows emptyScreenshot 2020-07-21 10.53.41.png
  5. Moving to my project directory, it shows hubspot installed, but nothing underneath itScreenshot 2020-07-21 10.54.25.png
  6. I try installing in project directory, same issue. It shows HubSpot installed with nothing underneath it and hs init returns the same "zsh: command not found:hs" message.

What am I doing wrong?

0 Upvotes
1 Akzeptierte Lösung
SandyG1
Lösung
Mitwirkender/Mitwirkende | Partner
Mitwirkender/Mitwirkende | Partner

CMS CLI installation issues

lösung

if not, you'll need to follow these steps as a prerequisite

 

1  npm init

 

2  npm install @hubspot/cms-cli

 

3  npx hs init

 

Ah! I see what you've done 🙂 haha

 

You need a new folder mate, sorry to tell you.. Clear it out. and follow this Mann (zwinkernd)

Lösung in ursprünglichem Beitrag anzeigen

11 Antworten
SandyG1
Mitwirkender/Mitwirkende | Partner
Mitwirkender/Mitwirkende | Partner

CMS CLI installation issues

lösung

Hi @DirtyBirdDesign 

 

Try 

npx hs init

 

Sandy Smiley (überglücklich)

DirtyBirdDesign
Teilnehmer/-in

CMS CLI installation issues

lösung

Thank you Sandy. I ran npx his init, and this was shown 

npx: installed 59 in 5.121s

is that expected? 

0 Upvotes
SandyG1
Mitwirkender/Mitwirkende | Partner
Mitwirkender/Mitwirkende | Partner

CMS CLI installation issues

lösung

Oh, that's not quite right! It looks like you've not initiated npm correctly and installed the cli dependancy

 

0 Upvotes
DirtyBirdDesign
Teilnehmer/-in

CMS CLI installation issues

lösung

Nothing happens after - according to the documentation here https://developers.hubspot.com/docs/cms/guides/getting-started I should be prompted to create a key and to set up the account.

0 Upvotes
SandyG1
Mitwirkender/Mitwirkende | Partner
Mitwirkender/Mitwirkende | Partner

CMS CLI installation issues

lösung

Have you initiated a node package module?

 

for example do you have this package.json in the root of your project?

{
  "name": "theme-2020",
  "version": "0.0.1",
  "description": "xxxxx",
  "main": "index.js",
  "scripts": {
    "start": "npx hs init",
    "create-theme": "npx hs create website-theme ${npm_package_name}",
    "watch": "npx hs watch ./${npm_package_name} ${npm_package_name} --remove",
    "create-module": "./hs-create-module.sh ${npm_package_name}",
    "delete": "npx hs remove ${npm_package_name}"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/andanotherday/xxxxx-hs.git"
  },
  "author": "andanotherday.com",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/andanotherday/xxxxx-hs/issues"
  },
  "homepage": "https://github.com/andanotherday/xxxx-hs#readme",
  "dependencies": {
    "@hubspot/cms-cli": "^1.1.9"
  }
}

 

0 Upvotes
SandyG1
Lösung
Mitwirkender/Mitwirkende | Partner
Mitwirkender/Mitwirkende | Partner

CMS CLI installation issues

lösung

if not, you'll need to follow these steps as a prerequisite

 

1  npm init

 

2  npm install @hubspot/cms-cli

 

3  npx hs init

 

Ah! I see what you've done 🙂 haha

 

You need a new folder mate, sorry to tell you.. Clear it out. and follow this Mann (zwinkernd)

lochwooe
Teilnehmer/-in

CMS CLI installation issues

lösung

Finally it works! Thank you

0 Upvotes
DirtyBirdDesign
Teilnehmer/-in

CMS CLI installation issues

lösung

Sandy, thank you very much. You should write the documentation! Very much appreciated!

 

0 Upvotes
SandyG1
Mitwirkender/Mitwirkende | Partner
Mitwirkender/Mitwirkende | Partner

CMS CLI installation issues

lösung

aha, you're welcome 🙂

Just for yours and others references:

Running npm install -g @hubspot/cms-cli should have worked, however as I'm running a project that will be shared between people. My steps require hubspot-cli to be in the project root. This means that it will automatically install hubspot cli for everyone that works on this project with me.

 

Enjoy!

0 Upvotes
DirtyBirdDesign
Teilnehmer/-in

CMS CLI installation issues

lösung

All it has in it is this

{
  "name": "@hubspot/cms-cli",
  "version": "1.0.0",
  "description": "Hubspot CMS CLI",
  "main": "index.js",
  "scripts": {
    "test": "hs init"
  },
  "repository": {
    "type": "git",
    "url": "@hubspot/cms-cli"
  },
  "keywords": [
    "Hubspot",
    "CMS",
    "CLI"
  ],
  "author": "HubSpot",
  "license": "ISC"
}

I am just dollowing the documentation - perhaps too literally - and didn't see what was described as the next step. I apologize for my ignorance here - I usually stick to the ruby and homebrew pkg management environments.

0 Upvotes
sharonlicari
Community-Manager/-in
Community-Manager/-in

CMS CLI installation issues

lösung

Hey @DirtyBirdDesign    

 

Thank you for the information provided. I'll tag a few experts.  

 

Hey @stefen @Jsum @prosa  what would you advise in this case?  

 

Thanks

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




0 Upvotes