Nodejs Introduction to basic use

Source: Internet
Author: User

node. js1.NVM

Node 's version management tool for switching The version of node

First, download nvm, put in plain English path

Second, open the Nvm.exe with the command line

Third, open the Setting.txt, which has four configurations.

Root:nvm Current installation path

Path:c:/develop/nodejs

Arch: system Operation bit 64/32

Proxy:none

Open Nvm.exe with the command line , enter the NVM to see if there is any use

If you do not use double-click install.cmd, copy the nvm installation path to the back, enter.

fill in the root and path path, save

if setting.txt has not come out, create a new one directly.

Open the command line (shift+ right), enter the nvm, and the version information is configured successfully.

If there is no nodejs shortcut

Open the environment variable and delete the two system environment variables that begin with NVM.

Open the System environment variable and delete The path we just configured in path

It means that we reconfigure this variable

Nvm_home=c:\develop

Nvm_symlink=c:\develop\nodejs

2.Npm

Node 's package management tool, which manages all node packages and all the packages needed for the front end.

CMD command line, use npm install + package name can be downloaded directly.

Command:

NPM Init initializes the project configuration.

NPM init--yes automatically generates configuration files.

NPM Uninstall & NPM Install is installed and uninstalled respectively.

NPM Install package name -save to record the package you downloaded

when someone else uses your project, you can download all the associated packages directly from NPM install.

similar to Bower, it isalso a package management tool that uses bower install similar to npm .

3.Gulp Automated build tools

the package downloaded via NPM can be sass automatically compiledby some nodejs code ,JS file encryption, etc.

Gulp itself has only four functions, create a new gulpfile.js file in the project

then Enter gulp + by CMD to perform the task name.

GULP.SRC (); fetch a file

Gulp.dest (); set a file input key file

Gulp.task (); Create a task

Gulp.wacth(); Listen to a file

Website address:

Www.gulpjs.com

inside Plugins can look at the plug-in name, and then use npm download.

To learn about GitHub, see the following directly!

4.Git

It was originally used by the father of Linux to save the management code.

Used to change the code version.

Command Line code:

GIT init initialization.

When you're not using git , it's a normal folder.

Git status to view the change status of the local repository.

Git Add adds the files you need to keep track of, and those libraries are generally not recorded.

How do I add a file that doesn't track?

in the project library . Gitignore File

Just write the file name on it.

Git commit A version code is ready to commit to save the storage.

Git commit-m ' version of the description '

git log read the message on commit

git reset--hard back to previous version + hash value first 6 bits

5.GitHub

a provider of Git services

Create a new repository on your GitHub, default, and do not automatically generate MD files.

specific warehouse push operations

Find your own project folder

Right -+shift Open command line

Input

Git-init Initialize the folder

git add + The file name you need to upload

Git commit-m ' submit version of Information '

Git is version-changing project management, where you can write some version of the information

Git remote add origin + The warehouse address you just created is copied over

Git push-u Origin Master

you'll be asked to enter your GitHub account and password when you're done.

If it is correct, it will be transferred, and then you can refresh GitHub and your files will go up.

my GitHub

https://github.com/zzc5464

Nodejs Introduction to basic use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.