Recently started contacting the build tool Webpack, the company computer is Windows, and my own is Mac. Originally thought in their own computer installation is very simple, but a bit of a problem, so write to share the next.
Here is the NPM installation, first you want to install node. js, here is the address https://nodejs.org/en/download/
node. JS installation I'm not going to say much, it's very simple and common software installation is no different.
When node. JS is installed, you are installing node and NPM, below we open the Terminal Execution command to view the following:
Node-v "View node version", npm-v "View NPM version"
Ok, the interface is installed through NPM Webpack, in the terminal input:
-G indicates global installation
NPM Install Webpack-g
These operations are all fine under Windows, but I have an error installing Webpack on my Mac.
The reason analysis is: Under the Mac dependent package to write to the system important folder, because did not get root permission, so the write failed, causing the installation to fail.
One more step for Mac is that the terminal performs the following command first
$ sudo-s
After execution will appear the small key, you enter what will not show up, directly enter your power-on password and then in the return on it.
Get root after you go to install Webpack on the ~
Webpack installation under Mac