APIs & Integrations

JohanL
Contributor

Errors when running hs init --account=...

SOLVE

Hello all. 

 

I'm trying to set up the HS CLI for CRM development but I get stuck at step 2 in the process, that is running hs init. 

I've cleaned out and reinstalled node and npm and the installation step encounters no problem, but when doing init I get the following:

 

Require stack:
- /opt/homebrew/lib/node_modules/@hubspot/cli/node_modules/@hubspot/cli-lib/projectsWatch.js
- /opt/homebrew/lib/node_modules/@hubspot/cli/commands/project/watch.js
- /opt/homebrew/lib/node_modules/@hubspot/cli/commands/project.js
- /opt/homebrew/lib/node_modules/@hubspot/cli/bin/cli.js
- /opt/homebrew/lib/node_modules/@hubspot/cli/bin/hs
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/opt/homebrew/lib/node_modules/@hubspot/cli/node_modules/@hubspot/cli-lib/projectsWatch.js:18:24)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
at Module.load (node:internal/modules/cjs/loader:1037:32)
at Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1061:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/opt/homebrew/lib/node_modules/@hubspot/cli/node_modules/@hubspot/cli-lib/projectsWatch.js',
'/opt/homebrew/lib/node_modules/@hubspot/cli/commands/project/watch.js',
'/opt/homebrew/lib/node_modules/@hubspot/cli/commands/project.js',
'/opt/homebrew/lib/node_modules/@hubspot/cli/bin/cli.js',
'/opt/homebrew/lib/node_modules/@hubspot/cli/bin/hs'
]
}

 

Any ideas on what I'm doing wrong?

0 Upvotes
1 Accepted solution
JohanL
Solution
Contributor

Errors when running hs init --account=...

SOLVE

@piersg When browsing the npm versions for the package I notice that the version tagged "@next" is an earlier version but the CRM Development page in HS when enrolled in the beta tells me to download using the next suffix. Is this information outdated, and should I just use the latest package instead?

View solution in original post

0 Upvotes
7 Replies 7
JohanL
Contributor

Errors when running hs init --account=...

SOLVE

I should probably mention that I installed using this command: 
npm install -g @hubspot/cli@next

I've now set up an Ubuntu VM and got the same issue. Running on an M1 Macbook.

0 Upvotes
tjoyce
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Errors when running hs init --account=...

SOLVE

@JohanL - Any chance you have another computer that you can try to install on. I find it suspect that you get the same results even in a virtual box. Perhaps the Mac m1 chip might be the issue, or running the terminal in Rosetta. It's possible there are some dependency binaries that aren't compatible with m1.

 

I would also try to install nvm and try a slightly older version of node if you can, as well as maybe an older version of the CLI  like 3.0.10

0 Upvotes
JohanL
Contributor

Errors when running hs init --account=...

SOLVE

Thanks for you reply. I actually got it going after figuring out that the npm package tagged "next" is an older beta and not the latest release of the cli client. It seems the information found some places on HS that one ought to install the "@next" version is outdated. I'm just keeping this thread alive a bit longer to maybe get final confirmation on this.

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Errors when running hs init --account=...

SOLVE

Hi, @JohanL. Thanks for reaching out. It's not 100% clear if we can troubleshoot this one with the available information. Hey, @piersg, do you have any good first troubleshooting steps for @JohanL in getting the HS CLI set up?

 

Thank you very much!  — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
piersg
Key Advisor

Errors when running hs init --account=...

SOLVE

Hmm @JohanL did you install the hubspot cli tools in a specific directory or globally?

0 Upvotes
JohanL
Contributor

Errors when running hs init --account=...

SOLVE

Running "which hs" I get:
/opt/homebrew/bin/hs

My prefix in npm config is /opt/homebrew so that, I believe, tells me that the tool is globally installed.

0 Upvotes
JohanL
Solution
Contributor

Errors when running hs init --account=...

SOLVE

@piersg When browsing the npm versions for the package I notice that the version tagged "@next" is an earlier version but the CRM Development page in HS when enrolled in the beta tells me to download using the next suffix. Is this information outdated, and should I just use the latest package instead?

0 Upvotes