Question 1:
Problems encountered after installing webpack:
Try to solve:
Method 1: I thought it was a network problem and the configuration was not downloaded completely, then re-download after uninstalling (unsolved)
Method 2: There is a problem with the configuration file, find someone else to copy the good file to the directory Next (unsolved)
Method 3: Uninstall nodejs, re-download the latest version of the installation (solved!!!)
Question 2:
After installation: Error: Local webpack: webpack: The "webpack" item cannot be recognized as the name of a cmdlet, function, script file or executable program.
Solution:
Method 1: Suspect that the installation is not global: Reinstall webpack (global): npm install -g webpack (unresolved or the same error)
Method 2: In your project root directory, there is a node_modules folder, There is a .bin folder under this folder, add the path to the system environment variable PATH option (unsolved)
Method 3: Think about not hitting webpack -v to check the version, just hit a webpack to try, the result appeared Question 3
Question 3
Error: webpack: unable to load the file C:\Program Files\nodejs\webpack.ps1 because it is forbidden to run scripts on this system. For more information, please refer
to the about_Execution_Policies
solution in https:/go. microsoft.com/fwlink/?LinkID=135170 :
1. Use the tools (idea, vs code, HbuilderX) opened by the administrator.
2. Command line execution: get-ExecutionPolicy, showing Restricted, indicating that the status is prohibited.
3. Execution: set-ExecutionPolicy RemoteSigned
4. Then execute get-ExecutionPolicy, it will display RemoteSigned
and find that problem two is solved! ! ! ! ! ! ! ! ! !
Successful solution