问答详情
源自:3-3 Electron告白程序(二)

找不到electron版本号

cuiyuejiaodeMacBook-Air:~ cuiyuejiao$ electron --version
-bash: electron: command not found
cuiyuejiaodeMacBook-Air:~ cuiyuejiao$ cnpm install -g electron
Downloading electron to /Users/cuiyuejiao/.npm-global/lib/node_modules/electron_tmp
Copying /Users/cuiyuejiao/.npm-global/lib/node_modules/electron_tmp/_electron@6.0.1@electron to /Users/cuiyuejiao/.npm-global/lib/node_modules/electron
Installing electron's dependencies to /Users/cuiyuejiao/.npm-global/lib/node_modules/electron/node_modules
[1/3] @types/node@^10.12.18 installed at node_modules/_@types_node@10.14.15@@types/node
[2/3] extract-zip@^1.0.3 installed at node_modules/_extract-zip@1.6.7@extract-zip
[3/3] electron-download@^4.1.0 installed at node_modules/_electron-download@4.1.1@electron-download
execute post install 1 scripts...
[1/1] scripts.postinstall electron@6.0.1 run "node install.js", root: "/Users/cuiyuejiao/.npm-global/lib/node_modules/electron"
[1/1] scripts.postinstall electron@6.0.1 finished in 4s
Recently updated (since 2019-08-04): 2 packages (detail see file /Users/cuiyuejiao/.npm-global/lib/node_modules/electron/node_modules/.recently_updates.txt)
  2019-08-08
    → @types/node@^10.12.18(10.14.15) (05:29:04)
  2019-08-05
    → electron-download@4.1.1 › nugget@2.0.1 › pretty-bytes@1.0.4 › meow@3.7.0 › normalize-package-data@2.5.0 › hosted-git-info@^2.1.4(2.8.2) (14:51:59)
All packages installed (144 packages installed from npm registry, used 8s(network 4s), speed 486.23kB/s, json 134(258.24kB), tarball 1.56MB)
[electron@6.0.1] link /Users/cuiyuejiao/.npm-global/bin/electron@ -> /Users/cuiyuejiao/.npm-global/lib/node_modules/electron/cli.js
cuiyuejiaodeMacBook-Air:~ cuiyuejiao$ electron -v
-bash: electron: command not found
cuiyuejiaodeMacBook-Air:~ cuiyuejiao$

提问者:Jessy_CYJ 2019-08-11 21:02

个回答

  • 神思者
    2019-08-12 09:37:55

    苹果系统安装npm或者cnpm插件要加上sudo