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
Step 2: Unzip and create a new folder node-cache, node-global
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
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.
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"
Step 5: Test whether the installation is successful
Step 6: Install webpack globally, any version
npm install [email protected] -g