I have been trying to install electron using npm on high sierra and I am unable to do so, sudo or changing folder permission, nothing seems to work.
I did see this error on several posts but most of them point to using the correct node version. Some links I checked: 1 2
I was on version 9.2.1 but switched to version 8.2.1 based on what I saw in electron.
Below is the screenshot of the error:
Is this because for some reason I am forbidden from adding certain files to my root? I have tis doubt because of late I am having a lot of hassle installing any software. Is there a way to get rid of this problem for good?
I had faced same problem, the reason behind is the installer you use to install your node either brew or nvm doesn't has root access privileges.
brew :- By default brew doen't have root access permission to install applications.
nvm :- same case for nvm, Installed Node doen't have root access permission to install libs.
First option, Install nodejs manually by downloading from server, install it and then try to install electron by using following command
npm install electron --save-dev
or
sudo npm install electron --save-dev
Second option, give the nvm or brew root privileges
Related
I just installed the ubuntu subsystem.
I have not installed node yet but it has a nodejs directoy under /mnt/c/Program files/nodejs.
The problem is that I can run npm after installing node. It gives me this error:
I uninstalled and reinstalled the linux subsystem, but the directroy is always there. I tried all of the solutions online for dealing with this error but none of them worked.
I can't even remove this directroy because of permissions. Even sudo-ing won't work.
How can i fix this and get npm running?
The folder you’re browsing to is actually your Windows installed Node version.
You’re better off installing nvm or just using nodesource to download and install Node.
NVM is my preference if you’re needing to install multiple versions for dev purposes etc. nvm
I tried updating to v12.5. I was using node version 8 before this. When I installed node v12.5 npm stopped working.
Whenever i try installing any package with npm. It shows this error.
I tried deleting node through different sources. But, it did not work.
I also tried reading different articles like these
https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/
https://websiteforstudents.com/install-the-latest-node-js-and-nmp-packages-on-ubuntu-16-04-18-04-lts/
https://www.rosehosting.com/blog/how-to-install-node-js-on-ubuntu-16-04/
I almost tried all the sources available on web.
I tried
sudo apt purge node
sudo apt autoremove
and some similar commands. But, it did not work.
Whenever i type node -v. it still shows me 12.5
and when i type npm -v. it shows me 5.5.1.
How do i either remove node completely?
or
install specific version of node?
or upgrade npm to version 8.x
How do I solve the problem?
I cannot even install anything, it shows this error even after installing some other packages.
how do i solve it?
EDIT:
I found the solution...
its basically using nvm to install different versions of node in your machine.
and setting default version for your machine using nvm
I need some help and clarification regarding Yarn installation process.
MacOS ver. 10.14.2
I've installed Homebrew via official site (ver. 2.0.1).
I've installed NPM by downloading package from official site (ver. 10.15.1 LTS).
Now when I tried to install yarn via brew install yarn
I have the following error:
The post-install step did not complete successfully
You can try again using `brew postinstall node`
As I undertand, NPM installs node locally, when, for instance, I try to use create-react-app. When I use Homebrew to install yarn, it tries to install node globally. And we have conflict here.
I've found suggestion to use:
sudo chown -R `whoami`:admin /usr/local/
I am not entirely sure what this command does.
So, the questions are:
Why changing the owner of the folder should be a solution? How will it affect multi user system?
What is the correct way to install yarn?
Can be there any conflicts if node is installed globally and locally (app folder.)
P.S. Please correct me, if I have wrong understanding here.
As Trott points out, npm does not install Node. npm is a package manager that comes bundled with Node. If you install Node, you automatically install npm.
Why changing the owner of the folder should be a solution? How will it affect multi user system?
It's not. Changing the permissions of this folder is sometimes suggested as a workaround for when you have npm installed in a location owned by root. This can cause EACCES errors when you try to install packages globally.
What is the correct way to install yarn?
While you can install Yarn through the Homebrew package manager, I would recommend doing: npm install -g yarn.
Can be there any conflicts if node is installed globally and locally (app folder).
You can't install Node globally and locally. You can install multiple versions of Node on the same machine, however.
I'm not a big fan of having one global Node installation, as it makes it a pain to update (esp. if one application relies on an older version of Node) and, depending on how you install Node, it can lead to permissions errors.
The better way is to use a version manager. This will allow you to install multiple Node versions on your machine, avoid permissions errors and swap between these Node versions at will.
I would recommend using nvm. It works nicely on MacOS. The TL;DR for installing nvm is:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
But I would encourage you to look at the project on GitHub and read its README. There is also a good tutorial on how to use it here.
Once you have Node installed using nvm, run npm install -g yarn to install Yarn globally and you should be off to the races.
Finally, you might want to read this tutorial on using npm, as it could help to clear up some of the concepts.
HTH
I have faced a problem after install yarn by running npm install -g yarn command in my OS Windows 10 Pro. That was showing yarn' is not recognized as an internal or external command operable program or batch file.
Whatever, I have found the solution:
After npm,
go to CMD from your windows PC,
write : *npm install -g yarn*
then,
Go to Environmental Variables set up.
Edit Path and add new and paste:
C:\Users\User\AppData\Roaming\npm\node_modules\yarn\bin\
Restart your terminal. And then check again in your cmd by running :
*yarn* or *yarn --version*
I already have npm and NodeJS installed, but both are very outdated and all I want is to update its versions.
I have tried to download the latest NodeJS LTS binary, and then added the path to PATH environment variable. However, running node -v or npm -v after that gives me the old versions.
Is there any other way to solve this problem?
Uninstalling older NodeJS didn't work without admin right too.
Thank you in advance!
You cannot upgrade nodejs without admin rights. However, you can install separate binaries.
However, if you do have admin rights, run the shell and enter:
npm install -g npm-windows-upgrade
npm-windows-upgrade
I am using OSX El Capitain and have just downloaded Appcelerator Studio. After the installation I tried to run it and when I try to log in I receive this error message: Unable to locate CLI executable (print screen below). I have already installed NodeJs downloaded directly from Appcelerator website.
How could I solve this?
There could have been an issue installing the the CLI depending on permissions. Appcelerator Studio installs node (if required), appcelerator CLI, Titanium CLI and others into a package underneath the AppceleratorStudio.app package. This is to ensure that it has those available.
I would recommend checking your permissions and potentially re-installing Appcelerator Studio from the link :
web.appcelerator.com
Additionally you could install the CLI's globally using the following commands:
sudo npm i -g appcelerator
sudo npm i -g titanium
sudo npm i -g alloy
Once they are installed, see about running studio again to see if you still have issues.
Maybe your CLI is not be installed properly that's why you get this error. So try to install the CLI manually through the terminal respectively
sudo npm install -g appcelerator
appc use latest
appc setup
sudo npm install -g alloy
Here's the documents link -
https://web.appcelerator.com/product/cli
Then open the studio. Hope this helps.
Regards,
Appcelerator support.
Apart from the reason given by #bert-g, it might also because an old version of node (i.e. node 0.10) was installed instead of 0.12.
I was using nvm for node version control. When starting the app from application icon, it stuck at the same screenshot. Therefore I have tried to start the app from console (i.e. /Applications........./AppceleratorStudio) and it complains my node version should be 0.12. Used nvm install 0.12 and run from console again, it works!
So whenever dev tools have problems with CLI things, the first thing I do is reinstall Xcode. Fixed everything almost every time.
This should unlink the libraries, uninstall, and remove Xcode
Go to Terminal and run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo rm -rif ~/Applications/Xcode.app
Then go to the App Store and reinstall Xcode
Do make sure you are up to date, install the CLI tools from HERE
You need both Xcode and the CLI tools. I am not sure if the CLI tools are downloaded with Xcode so make sure by downloading both.
Please let me know if this works!
Update: Must have Appcelerator CLI installed and configured as well