Error content
[webpack-cli] Error: Unknown option '--inline'
[webpack-cli] Run 'webpack --help' to see available commands and options
Error screenshot
Error scene
I moved the code that was originally built and run on the windows system to the ubuntu system, and such an error was reported when executing npm run dev (all related dependent software has been installed).
I searched the Internet for a long time but couldn't find a solution. Later, I found someone mentioned a solution to this problem on an English website, but it may be that the usage scenario is wrong and it was not adopted. But that solution is effective for the error report in my scenario.
Solution
- Deleting the node_modules folder and package-lock.json file
information is precious, please make sure that there is no important information that needs to be used in the file and folder before deleting
- Execute the following code on the command line to read the configuration of the installed package.json
npm i
or
npm install
Both commands are the same, except that one is abbreviated.
3. Waiting for the build
If the download of the build is found to be stuck or very slow, it is recommended to replace the npm mirror.
I heard that the address of the Taobao mirror has been changed, as shown in the figure below,
the new mirror address is:
http://npmmirror.com
http://registry.npmmirror.com
- After the build is successful, you can perform the next steps