Nodejs installation and configuration

Window installation, next step, next step, configuration

After creating the folder, open CMD and type:

npm config set prefix "D:\nodejs\node_global"Note: Change the path here to NPM config, the path of the folder you createdset cache "D:\nodejs\node_cache"Note: The path here should be changed to the path of the folder you createdCopy the code

  • Go to the environment variables dialog box and create NODE_PATH under System Variables.

  • Type [D:\nodejs\node_global\node_modules],

  • D:\nodejs\node_global = D:\nodejs\node_global

  • After configuration, install a Module test, we will install the most commonly used Express module, open CMD window,

  • Enter the following command to install the module globally: NPM install express-g Note -g means global installation

Nodejs in source

  • NPM install is slow to be installed
  • Foreign mirroring will be slow
  • The registry can be viewed with the get command
npm config get registry
Copy the code
  • The original result is
http://registry.npmjs.org
Copy the code
  • Replace ali’s image with the set command
npm config set registry https://registry.npm.taobao.org
Copy the code
  • Reexecute command
npm install
Copy the code
  • Or just do it
npm install --registry=https://registry.npm.taobao.org
Copy the code

With CNPM

npm install -g cnpm --registry=https://registry.npm.taobao.org
Copy the code

Then configure the environment variables

Node – sass

cnpm install node-sass@latest
Copy the code

or

So use

npm install -g cnpm --registry=https://registry.npm.taobao.org 
Copy the code

, from taobao mirror that download, and then CNPM download success.

The last input

cnpm install node-sass --save
Copy the code

NPM Run Dev can finally run!!

npm i node-sass -D
Copy the code

Nodejs runs the command

Run the following command on the IDEA command line:

npm install
Copy the code

Download related dependencies;

Run the following command on the IDEA command line:

npm run dev
Copy the code

Running projects;

The yum command completely removes nodejs and reinstalls it

  • The first step is to delete the package with the built-in package management
yum remove nodejs npm -y
Copy the code
  • Manually Deleting Residues

  • Go to /usr/local/lib and delete all node and node_modules folders

  • Go to /usr/local/include and delete all node and node_modules folders

  • Go to /usr/local/bin to delete the node executable file

  • Install the latest Xz package from nodeJS

# downloadWget HTTP: / / https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.xz# decompressionXz -d node-v9.8.0-linux-x64.tar.xz tar - XVF node-v9.8.0-linux-x64.tar# enter directory
    cdNode - v10.13.0 - Linux - x64 /Create a soft connectionLn -s/opt/nodejs/node - v10.13.0 - Linux - x64 / bin/node/usr /local/bin/node
    ln -s /opt/nodejs/node-v10.13.0-linux-x64/bin/npm /usr/local/bin/npm
    
# test
    node -v
    npm -v
    
 # Configure taobao mirror
    npm config set registry https://registry.npm.taobao.org
Copy the code