Issue Installing Sass

I believe I have the latest version of NPM (9.5.1 ) installed. In visual studio code I type: npm install -g sass then I receive this error.. See image attached.. (if anyone knows what is going on and how I can resolve this issue to globally install sass I would be most grateful!)
No description
5 Replies
Oli_T
Oli_T2y ago
Ahh I think resolved... L. ran the installation command with elevated privileges by using 'sudo' sudo nom install -g sass
Joao
Joao2y ago
@OG_Token As the error message says you don't have permissions to write to /usr/local/lib. This is common when installing globally. And for good reason as a lot of malware has been found even on well-known packages, so proceed at your own risk. Your options: 1) Install sass locally, on a per-project basis. One more install is not going to hurt and is only for development purposes. 2) Force the installation using sudo if you are on a Mac. Bad security practice. 3) Change the directory for global installations so you get best of both worlds: https://www.youtube.com/watch?v=YGxO-lPhsK0 Honestly, I prefer option 1.
Steve Griffith - Prof3ssorSt3v3
YouTube
Changing the global NPM Install Location for Win & Mac
Ever get tired of using sudo for all your npm installs? Want to avoid that problem? Want to change where npm installs your global packages? You are moments away from regaining control over npm. Reference notes from video: https://gist.github.com/prof3ssorSt3v3/a5d5c47a774d907bb47e630492f289d2
Joao
Joao2y ago
Ugh, forgot to scroll down to see you got this solved. Either way I think you can still learn something from the video.
samidev
samidev2y ago
try sass --version i've had the same problem but i formatted my pc then ye
tlcheung
tlcheung15mo ago
I had the same problem (mac ventura 13.4.1) I've previously used SASS originally as an extension and then following Kevin's youtube tutorial https://www.youtube.com/watch?v=o4cECvhrBo8 with Stephanie Eckles' build setup https://thinkdobecreate.com/articles/minimum-static-site-sass-setup/. But this was the 1st time trying to install globally (sort of a nightmare on a mac.) I was able to get it installed by using Homebrew's package https://github.com/Homebrew/brew/releases/tag/4.1.3 and then typing "brew install sass/sass/sass" into the terminal. It's a lot more work than Kevin's video suggests but global makes a lot of sense to me once you are working on multiple projects
Minimum Static Site Setup with Sass | Stephanie Eckles
Use this command line combination for building a static site that includes Browsersync, processing Sass and running the final files through autoprefixer and cssnano.
GitHub
Release 4.1.3 · Homebrew/brew
What's Changed docs: add documentation for staging branches by @carlocab in #15771 docs/Installation: document macOS .pkg installer. by @MikeMcQuaid in #15755 extend/ENV/super: add ENV.O3 by @...
Want results from more Discord servers?
Add your server