CMS Development

LBåtelson
Participant

npm ERR when trying to install HubSpot CLI

Hi,

 

I get the following error (see below) when trying to install the hubspot CLI. Using Mac, zsh, and nvm. What can I do to solve this permission issue?

When running ls -la, I can see that I am the owner of the node_modules folder as well as the @hubspot-folder, not root. 

 

Could the issue be caused because I first tried running the npm install @hubspot-command with bash in the terminal, but then changed back to zsh? Is there any way to remove the @hubspot-folder in node_modules/uninstall hubspot cli to be able to try again from scratch?

Would be really greatful for some guidance on how to solve this‌🙏

 

 

npm ERR! code EACCES

npm ERR! syscall mkdir

npm ERR! path /usr/local/lib/node_modules/@hubspot

npm ERR! errno -13

npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@hubspot'

npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@hubspot'] {

npm ERR!   errno: -13,

npm ERR!   code: 'EACCES',

npm ERR!   syscall: 'mkdir',

npm ERR!   path: '/usr/local/lib/node_modules/@hubspot'

npm ERR! }

npm ERR! 

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR! 

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator.

0 Upvotes
3 Replies 3
Anton
Recognized Expert

npm ERR when trying to install HubSpot CLI

Hi @LBåtelson

while running commands with "sudo" isn't recommended, it can help. 

Also check the folder permissions.

 

Here are some useful resources for permissions

 

to delete the hubspot-folder there are a few ways:

  • search for the folder, right click and hit delete - kinda obvious 😂
  • run a delete command how it's described in this guide and/or this dev documentation

 

hope this helps

 

best, 

Anton

Anton Bujanowski Signature
LBåtelson
Participant

npm ERR when trying to install HubSpot CLI

Hi Anton!

Thanks for your reply ‌🙌

 

I have checked the permissions and my user have all the right permissions (drwxr-xr-x) but I still don't get access...

 

Love the obvious solution‌😂‌ I tried uninstalling it both in the terminal and then I deleted the @hubspot-folder inside the node_modules folder. Tried to install hubspot cli again (using the command npm install -g @hubspot/cli) - but I still get the same error as mentioned above. Why (?!) do I get permission denied on a folder that doesn't even exist (not visible anywhere, not existing in node_modules folder and I've emptied the trash) that I am trying to install? Any ideas?‌😅‌ 

I really don't know what the next step is.

 

Thanks again!

Linn

 

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

npm ERR when trying to install HubSpot CLI

Hi, @LBåtelson 👋 Thanks for reaching out! Let's see if the community has any insight — hey @JBeatty @Anton have you navigated this space before?

 

Thank you very much for taking a look! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot