When initializing the webpack project with Vue cli, use the following commands:
$ vue init webpack [project-name]
After setting up the agent of NPM and modifying the domestic image warehouse, an error is still reported. The error information is as follows:
$ vue-cli · Failed to download repo vuejs-templates/webpack: unable to verify the first certificate
According to the information, the reason for this problem is that we use the proxy server, so Vue cli cannot verify the proxy server certificate when downloading the webpack template, so this error is reported
to solve this error, one way is to turn off the verification of SSL certificates. However, this method is not valid for everyone, and the following method is only used when your proxy server is trusted:
$ npm config set npm_config_strict_ssl=false
If this method doesn’t work, another way is to use the offline method to initialize the Vue project.
Clone the webpack template project to the local C:\users [username]. Vue Templates folder. If there is no such folder, create one. The folder starting with. Cannot be created in windows. You can use CMD or PowerShell to switch to the C:\users [username]\directory and enter the following command to create the folder:
$ mkdir .vue-templates
The download address of the webpack template is: vuejs templates. Select the required template to clone. I select the complete webpack template here. You can clone the project to the folder we created in the previous step through the following command (provided that git Bash is installed):
$ git clone https://github.com/vuejs-templates/webpack ~/.vue-templates/webpack
-
- If Git is not installed, you can also directly download the project in the form of zip on the GitHub and extract it into. Vue templates. Generally speaking, if the clone speed of Git is too slow, you can also directly download and extract the zip in step 3 in addition to setting the agent… Rerun the command of Vue to initialize the project. Note that the offline mode is
$ vue init webpack [project-name] --offline
$ cd [prject-name]
$ npm run dev
Read More:
- [Solved] node.js request Error: Error: unable to verify the first certificate
- [Solved] Vue Route Error: Uncaught TypeError: (0 , vue__WEBPACK_IMPORTED_MODULE_42__.defineComponent) is not a function
- Vue-cli Failed to download repo vuejs-templates/webpack [How to Solve]
- [Solved] Vue Start Project Error: ValidationError: webpack Dev Server Invalid Options
- [Solved] Vue uses webpack to package error: Createapp is not a function
- When starting Vue project: cannot find module ‘webpack cli/bin/config yargs’ error resolution
- [Solved] Vue Project Error: “TypeError: Cannot read properties of undefined (reading ‘init‘)“
- [Solved] Vue Less error: Webpack project report expected indentation of 0 spaces but found 2
- [Solved] Vue Project Error: Error: Cannot find module ‘webpack‘ Require stack以及Error: Rule can only have one resource so
- Vue3.0 error: Failed to resolve component el-form-item (el element to be unable to be displayed)
- [Solved] vue3vite Error: Failed to resolve import “@vue/server-renderer from “src\App.vue“. Does the file exist
- Vue2.0: How to Use vue3 api to encapsulate Axios
- How to Solve npm init @vitejs/app Error
- How to Solve Webpack packag iconfont font error
- [Solved] Webpack compile error: SyntaxError: Unexpected token =
- [Solved] Vue3.0 Error: The component has been registered but not used vue/no-unused-components, Close eslint
- [Solved] Vue Error: Uncaught TypeError: Vue.createApp is not a function
- Full screen scrolling by Vue + Vue awesomeswiper
- [Solved] VUE D:\project\vueProject\vue-02\src\components\hello.vue 5:5 error Parsing error: x-invalid-end-tag
- Vue installation @ Vue/cli error: npmerr gyp err