cmd显示如下
C:\Users\51293>cnpm install -g electron
Downloading electron to C:\Users\51293\AppData\Roaming\npm\node_modules\electron_tmp
Copying C:\Users\51293\AppData\Roaming\npm\node_modules\electron_tmp\_electron@6.0.0@electron to C:\Users\51293\AppData\Roaming\npm\node_modules\electron
Installing electron's dependencies to C:\Users\51293\AppData\Roaming\npm\node_modules\electron/node_modules
[1/3] @types/node@^10.12.18 installed at node_modules\_@types_node@10.14.14@@types\node
Install fail! TypeError: this[method] is not a function
TypeError: this[method] is not a function
at GitHost.toString (C:\Users\51293\AppData\Roaming\npm\node_modules\cnpm\node_modules\hosted-git-info\git-host.js:154:22)
at Object.fixRepositoryField (C:\Users\51293\AppData\Roaming\npm\node_modules\cnpm\node_modules\normalize-package-data\lib\fixer.js:31:87)
at C:\Users\51293\AppData\Roaming\npm\node_modules\cnpm\node_modules\normalize-package-data\lib\normalize.js:32:38
at Array.forEach (<anonymous>)
at normalize (C:\Users\51293\AppData\Roaming\npm\node_modules\cnpm\node_modules\normalize-package-data\lib\normalize.js:31:15)
at Object.readPackageJSON (C:\Users\51293\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\utils.js:43:3)
at readPackageJSON.next (<anonymous>)
at onFulfilled (C:\Users\51293\AppData\Roaming\npm\node_modules\cnpm\node_modules\co\index.js:65:19)
npminstall version: 3.23.0
npminstall args: C:\Program Files\nodejs\node.exe C:\Users\51293\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-versions --china --userconfig=C:\Users\51293\.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=https://r.npm.taobao.org -g electron
你的Node.js是最新版本么?
稳定版