Node installation and environment configuration and webpack installation tutorial [compressed package version] (detailed)

In order for webpack to run normally, it must rely on the node environment. In order to execute more code normally, the node environment must contain various dependent packages.

Npm tool {node packages manager} (used to manage the packages under it)

First install and configure node environment official website entrance: click to download

The first step: download

Download according to the number of bits of your computer
Insert picture description here

Step 2: Unzip and create a new folder node-cache, node-global

Insert picture description here

Step 3: Configure environment variables

NODE_PATH=The path where the node.exe file is
located. Add the directory where node.exe is located to the path environment variable, so that we can use the node command in any path when using the command line
Insert picture description here

And configure the npm global installation location node-global.
Since webpack is mapped in the node-global folder, you must add node-global to the path environment variable.
Insert picture description here

Step 4: Configure the storage path of the global module of npm and the path of the cache

npm config set prefix "the path of the created node_global folder"
npm config set cache "the path of the created node_cache folder"
Insert picture description here

Step 5: Test whether the installation is successful

Insert picture description here

Step 6: Install webpack globally, any version

npm install [email protected] -g
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/dwjdj/article/details/108285961