On trying to install gatsby-cli I get this error. ...
# tribe
k
On trying to install gatsby-cli I get this error. Searching on stackoverflow didn't yield any helpful solutions. What am I doing wrong? (I'm new to programming)
s
looks like you don't have permission to write to the directory where npm installs globally.
k
@swift-school-95990 how do I change that?
m
drop the -g
e
Yes, no need to install globally. But, you should add your bin path to your zsh config file.
npm config set prefix '~/.npm-packages'
Open the config file in nano.
nano ~/.zshrc
Add this line.
export PATH=$PATH:$HOME/.npm-packages/bin
☝️ 2
k
removing -g worked I think, still got these warnings though.
b
Consider using a node version manager like ‘nvm’.
💯 1
f
s
• You can either move the global folder to something that you have write access to and add that path to your
PATH
variable. • Install without
-g
which you will have it installed but might require you to use the direct path to the script
node_modules/gatsby-cli/bin/...
• use
homebrew
if the package is there.
e
That just means that uuid, a package used for generating unique strings for primary keys and such, is an older version in the dependency list for gatsby-cli.
k
Open the config file in nano.
@echoing-sugar-95154 I'm a noob, what does this mean
e
@kind-queen-6796 nano is just a text editor that you can use inside your terminal. Feel free to replace the command with
code ~/.zshrc
to open the config file in VS Code instead.
r
@kind-queen-6796 this will help a lot in general. https://missing.csail.mit.edu/2020/course-shell/
🙏 1
m
Missing semester is really good