If you run the following command to install npm package: ``` npm install ``` and get an access error, you might be tempted to run this command with sudo and DevOps. Install npm packages without sudo 30 Apr by Tim Kamanin 1 min read. On Mac OS Yosemite. Saving file field uploads not in MEDIAROOT directory. Follow me @timonweb.
![]()
I've seen sudo npm. in a lot of tips and gists (including:-P).
![]() ![]()
While this can arguably be ok on a development machine, it's not a very smart thing to do, since npm packages can run arbitrary scripts and commands, which is unsafe, to say the least.But, for some reason, the for OS X won't automatically adjust the necessary folder permissions for you.If you already used the official installer, there's an to repair it: sudo chown -R $USER /usr/localIf you're installing Node.js with ( brew install nodejs), everything should be set up properly.
Set NPMPACKAGES ' $HOME/.npm-packages ' set PATH $NPMPACKAGES/bin $PATH set MANPATH $NPMPACKAGES/share/man $MANPATHIf you have erased your MANPATH by mistake, you can restore it by running set -Ux MANPATH (manpath -g) $MANPATH once. Do not put this command in your config.fish.Check out for doing the above steps automagicallyNOTE: If you are running macOS, the.bashrc file may not yet exist, and the terminal will be obtaining its environment parameters from another file, such as.profile or.bashprofile. These files also reside in the user's home folder. In this case, simply adding the following line to them will instruct Terminal to also load the.bashrc file.
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |