dcloudio / uni-preset-vue

uni-app preset for vue
Apache License 2.0
308 stars 116 forks source link

使用模板创建时出现RequestError: unable to verify the first certificate #65

Closed VentFiree closed 1 year ago

VentFiree commented 2 years ago

我在下载这个 uni-preset-vue 项目后使用模板创建 发现 RequestError: unable to verify the first certificate


D:\Vento\Projects\Vue\TestProject\uni-test-temp>vue create -p .\uni-preset-vue test1 --registry=https://registry.npm.taobao.org

Vue CLI v5.0.8
? Target directory D:\Vento\Projects\Vue\TestProject\uni-test-temp\test1 already exists. Pick an action: Overwrite

Removing D:\Vento\Projects\Vue\TestProject\uni-test-temp\test1...

Vue CLI v5.0.8
✨  Creating project in D:\Vento\Projects\Vue\TestProject\uni-test-temp\test1.
🗃  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...

added 914 packages in 22s
🚀  Invoking generators...

Preset options:
? 请选择 uni-app 模板 Hello uni-app
 ERROR  RequestError: unable to verify the first certificate
RequestError: unable to verify the first certificate
    at ClientRequest.<anonymous> (D:\Vento\Projects\Vue\TestProject\uni-test-temp\uni-preset-vue\node_modules\got\index.js:73:21)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:513:28)
    at TLSSocket.socketErrorListener (node:_http_client:494:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

D:\Vento\Projects\Vue\TestProject\uni-test-temp>

D:\Vento\Projects\Vue\TestProject\uni-test-temp>node -v v18.12.0

D:\Vento\Projects\Vue\TestProject\uni-test-temp>npm -v 8.19.2

D:\Vento\Projects\Vue\TestProject\uni-test-temp>vue -V @vue/cli 5.0.8

VentFiree commented 2 years ago

是否是因为 @vue/cli 5.0.8 的原因?

https://github.com/vuejs/vue-cli/issues/1427

VentFiree commented 2 years ago

在我尝试 将 node版本切换至v12.16.1 npm v6.13.4 @vue/cli v4.5.19 问题得以解决

### 但是我想询问下 具体是什么原因导致的 希望有人能够给予回答 感谢

[root@WH-Server ~]# node -v
v12.16.1
[root@WH-Server ~]# npm -v
6.13.4
[root@WH-Server ~]# vue -V
@vue/cli 4.5.19

[root@WH-Server temp]# npm install -g @vue/cli@4

[root@WH-Server temp]# npm install -g @vue/cli@4 --registry https://registry.npm.taobao.org
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated subscriptions-transport-ws@0.9.19: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated graphql-tools@4.0.8: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
npm WARN deprecated apollo-cache-control@0.15.0: The functionality provided by the `apollo-cache-control` package is built in to `apollo-server-core` starting with Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol for details.
npm WARN deprecated graphql-extensions@0.16.0: The `graphql-extensions` API has been removed from Apollo Server 3. Use the plugin API instead: https://www.apollographql.com/docs/apollo-server/integrations/plugins/
npm WARN deprecated apollo-tracing@0.16.0: The `apollo-tracing` package is no longer part of Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#tracing for details
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
/opt/software/node/node-v12.16.1-linux-x64/bin/vue -> /opt/software/node/node-v12.16.1-linux-x64/lib/node_modules/@vue/cli/bin/vue.js

> core-js-pure@3.26.1 postinstall /opt/software/node/node-v12.16.1-linux-x64/lib/node_modules/@vue/cli/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js 
> https://patreon.com/zloirock 
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> @apollo/protobufjs@1.2.2 postinstall /opt/software/node/node-v12.16.1-linux-x64/lib/node_modules/@vue/cli/node_modules/@apollo/protobufjs
> node scripts/postinstall

> ejs@2.7.4 postinstall /opt/software/node/node-v12.16.1-linux-x64/lib/node_modules/@vue/cli/node_modules/ejs
> node ./postinstall.js

Thank you for installing EJS: built with the Jake JavaScript build tool (https://jakejs.com/)

+ @vue/cli@4.5.19
added 956 packages from 588 contributors in 46.396s
[root@WH-Server temp]# vue create -p dcloudio/uni-preset-vue my-project
Fetching remote preset dcloudio/uni-preset-vue...
^C
[root@WH-Server temp]# vue create -p ./uni-preset-vue my-project
?  Your connection to the default npm registry seems to be slow.
   Use https://registry.npm.taobao.org for faster installation? Yes

Vue CLI v4.5.19
✨  Creating project in /root/temp/my-project.
⚙️  Installing CLI plugins. This might take a while...

> core-js@3.26.1 postinstall /root/temp/my-project/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

> ejs@2.7.4 postinstall /root/temp/my-project/node_modules/ejs
> node ./postinstall.js

added 1268 packages from 731 contributors in 26.207s

87 packages are looking for funding
  run `npm fund` for details

🚀  Invoking generators...

Preset options:
? 请选择 uni-app 模板 Hello uni-app
⠧ 模板下载中...
⠋ 模板下载中...
⠹ 模板下载中...
📦  Installing additional dependencies...

added 600 packages from 283 contributors and updated 3 packages in 19.296s

102 packages are looking for funding
  run `npm fund` for details

⚓  Running completion hooks...

📄  Generating README.md...

🎉  Successfully created project my-project.
👉  Get started with the following commands:

 $ cd my-project
 $ npm run serve

[root@WH-Server temp]# 
[root@WH-Server temp]# 
[root@WH-Server temp]# 
[root@WH-Server temp]# ls -al
total 64808
drwxr-xr-x  4 root root     4096 Nov 16 09:36 .
dr-xr-x---. 9 root root     4096 Nov 16 09:42 ..
drwxr-xr-x  5 root root     4096 Nov 16 09:42 my-project
-rw-r--r--  1 root root 23005690 Nov 16 09:00 node-v12.16.1-linux-x64.tar.gz
-rw-r--r--  1 root root 43336415 Nov 16 09:13 node-v18.12.1-linux-x64.tar.gz
drwxr-xr-x  5 root root     4096 Nov 16 09:34 uni-preset-vue
[root@WH-Server temp]# cd my-project/
[root@WH-Server my-project]# ls
babel.config.js  jsconfig.json  node_modules  package.json  package-lock.json  postcss.config.js  public  README.md  sfc.d.ts  shime-vue.d.ts  src
[root@WH-Server my-project]# ll
total 756
-rw-r--r--    1 root root   1803 Nov 16 09:42 babel.config.js
-rw-r--r--    1 root root    138 Nov 16 09:42 jsconfig.json
drwxr-xr-x 1020 root root  36864 Nov 16 09:42 node_modules
-rw-r--r--    1 root root   6986 Nov 16 09:42 package.json
-rw-r--r--    1 root root 691773 Nov 16 09:42 package-lock.json
-rw-r--r--    1 root root    868 Nov 16 09:42 postcss.config.js
drwxr-xr-x    2 root root   4096 Nov 16 09:42 public
-rw-r--r--    1 root root    274 Nov 16 09:42 README.md
-rw-r--r--    1 root root    250 Nov 16 09:42 sfc.d.ts
-rw-r--r--    1 root root     74 Nov 16 09:42 shime-vue.d.ts
drwxr-xr-x   12 root root   4096 Nov 16 09:42 src
[root@WH-Server my-project]# npm run serve

> my-project@0.1.0 serve /root/temp/my-project
> npm run dev:h5

> my-project@0.1.0 dev:h5 /root/temp/my-project
> cross-env NODE_ENV=development UNI_PLATFORM=h5 vue-cli-service uni-serve

​已开启 uni统计2.0 版本​ 

​【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097​ 

Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.
 INFO  Starting development server...

 WARNING  Compiled with 1 warning                                                                                                                                                                                                      9:43:33 AM

 warning  in ./src/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue?vue&type=template&id=ac1803ac&scoped=true&

Module Warning (from ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js):
(Emitted value instead of an instance of Error) <v-uni-view v-for="item in child">: component lists rendered with v-for should have explicit keys. See https://vuejs.org/guide/list.html#key for more info.

 @ ./src/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue?vue&type=template&id=ac1803ac&scoped=true& 1:0-750 1:0-750
 @ ./src/uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue
 @ ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/using-components.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-scoped-loader!./src/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue?vue&type=script&lang=js&
 @ ./src/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue?vue&type=script&lang=js&
 @ ./src/uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue
 @ ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--15-0!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/filter-modules-template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-scoped-loader!./src/pages/extUI/data-picker/data-picker.nvue?vue&type=template&id=52380bce&scoped=true&
 @ ./src/pages/extUI/data-picker/data-picker.nvue?vue&type=template&id=52380bce&scoped=true&
 @ ./src/pages/extUI/data-picker/data-picker.nvue
 @ ./src/pages.json
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://172.18.69.218:8080/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

  App running at:
  - Local:   http://localhost:8080/ 
  - Network: http://172.18.69.218:8080/
zhetengbiji commented 2 years ago

是说“unable to verify the first certificate”么,这个看起来是你网络问题,建议你切换网络试试

VentFiree commented 1 year ago

是说“unable to verify the first certificate”么,这个看起来是你网络问题,建议你切换网络试试

我也尝试着更换了网络 但还是这样。在一个请问这个东西 应该是证书的问题吧?

zhetengbiji commented 1 year ago

是说“unable to verify the first certificate”么,这个看起来是你网络问题,建议你切换网络试试

我也尝试着更换了网络 但还是这样。在一个请问这个东西 应该是证书的问题吧?

概率很小,具体要看是在哪个阶段出现。截图里的阶段请求的是 GitHub,大概率是网络问题。