Home >Web Front-end >JS Tutorial >Detailed explanation of the installation steps of Nodejs and Electron ubuntu

Detailed explanation of the installation steps of Nodejs and Electron ubuntu

php中世界最好的语言
php中世界最好的语言Original
2018-06-01 11:23:581220browse

This time I will bring you a detailed explanation of the installation steps of Nodejs and Electron ubuntu, what are the notes for the installation of Nodejs and Electron ubuntu, the following is a practical case, let's take a look.

nodejs installation

The version of nodejs is updated quickly, so there may be multiple versions on one system, and the management tools can also be diverse. , I chose to use nvm for installation. One reason is that management is simple, and the other is that there is no need to install nodejs first and then upgrade.

1. Install nvm

First check the nvm version, then replace the version information in the following script address to obtain nvm

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.10/install.sh | bash

2. Check the nvm version

nvm -v

#3. If nvm cannot be found, it should generally be a configuration problem. Check whether there is one in ~/.bash.rc ~/.profile or ~/.bash_profile As follows,

export NVM_DIR="/home/carl/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

4. Install node

Check the version of the installable node

nvm ls-remote

Of course install it You can use a variety of methods such as

××to install a stable version
nvm install stable
××to install a specific version. The version number can be found from the results in View Version above
nvm install 8.11.1
××View the current node version
nvm current
××View all node versions
nvm ls
××Switch the version used
nvm use 8.11.1

Install electron

Many online installations of electron use npm, but there is a problem with my execution here Yes, the installation failed, and the prompt was a permission issue. I have used sudo to install it. It may be that the network or configuration is not correct. There is no need to worry about it. I checked the online method and I chose cnpm to install it. Of course you You can also try to see if it can be installed

××npm安装
sudo npm install electron --save-dev --save-exact
××cnpm安装
npm install -g cnpm --registry=https://registry.npm.taobao.org
××使用cnpm进行安装,使用方法和npm相同
cnpm install -g electron

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

How to use Vue combined with Video.js to play m3u8 videos

##How to use Vue key modifier processing event

The above is the detailed content of Detailed explanation of the installation steps of Nodejs and Electron ubuntu. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn