I want to work on a project of mine. I had to factory restart my computer and needed to reinstall everything. I thought I did it and I went to run ionic serve
to see my project and start working on it, the console says: zsh: command not found: ionic
.
Not sure if this is necessary but the more info I can give I assume the better…
I am using a MacBook Air, running Monterey Version 12.7
node -v
v18.18.0
npm -v
9.8.1
git -v
git version 2.37.1 (Apple Git-137.1)
====
When I try to run:
npm install -g @ionic/cli
it gives me this:
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/@ionic
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@ionic'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@ionic'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/@ionic'
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.
npm ERR! A complete log of this run can be found in: /Users/zdisanto/.npm/_logs/2023-10-02T20_30_06_098Z-debug-0.log
What is going on and how do I fix this?