2 qq 32763075 qq_32763075 于 2017.09.02 22:34 提问

npm 安装任何模块都报错

npm ERR! code ERR_INVALID_ARG_TYPE
npm ERR! The "ca" argument must be one of type string, Buffer, TypedArray, or DataView

npm ERR! A complete log of this run can be found in:
npm ERR! /home/wusiqi/.npm/_logs/2017-09-02T14_21_36_949Z-debug.log

上面提示的.log内容如下:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli 'webpack',
1 verbose cli 'gulp',
1 verbose cli '-g' ]
2 info using npm@5.3.0
3 info using node@v9.0.0-pre
4 verbose npm-session 6974fb1697ebe308
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for webpack@latest The "ca" argument must be one of type string, Buffer, TypedArray, or DataView
8 silly fetchPackageMetaData error for gulp@latest The "ca" argument must be one of type string, Buffer, TypedArray, or DataView
9 verbose stack TypeError [ERR_INVALID_ARG_TYPE]: The "ca" argument must be one of type string, Buffer, TypedArray, or DataView
9 verbose stack at validateKeyCert (_tls_common.js:58:11)
9 verbose stack at Object.createSecureContext (_tls_common.js:91:7)
9 verbose stack at Object.exports.connect (_tls_wrap.js:1049:48)
9 verbose stack at HttpsAgent.createConnection (https.js:111:22)
9 verbose stack at HttpsAgent.createSocket (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/lib/_http_agent.js:271:26)
9 verbose stack at HttpsAgent.createSocket (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/lib/agent.js:77:11)
9 verbose stack at HttpsAgent.addRequest (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/agentkeepalive/lib/_http_agent.js:240:10)
9 verbose stack at new ClientRequest (_http_client.js:271:16)
9 verbose stack at Object.request (http.js:39:10)
9 verbose stack at request (https.js:239:15)
9 verbose stack at fetch.Promise (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:54:17)
9 verbose stack at Promise ()
9 verbose stack at fetch (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/index.js:41:10)
9 verbose stack at retry (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/index.js:317:14)
9 verbose stack at /usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/promise-retry/index.js:29:24
9 verbose stack at
10 verbose cwd /home/wusiqi/desk/study/music_box
11 verbose Linux 4.2.0-42-generic
12 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "webpack" "gulp" "-g"
13 verbose node v9.0.0-pre
14 verbose npm v5.3.0
15 error code ERR_INVALID_ARG_TYPE
16 error The "ca" argument must be one of type string, Buffer, TypedArray, or DataView
17 verbose exit [ 1, true ]

2个回答

caozhy
caozhy   Ds   Rxr 2017.09.03 22:22
y7070y
y7070y   2017.09.06 11:15

同问--
使用淘宝镜像并不能解决这个问题

Csdn user default icon
上传中...
上传图片
插入图片