如何在64位Ubuntu16.04系统下安装electron
生活随笔
收集整理的這篇文章主要介紹了
如何在64位Ubuntu16.04系统下安装electron
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、Electron簡介
Electron【官網https://electronjs.org/】是由Github開發,基于Chromium和Node.js,使用JavaScript、HTML和CSS等Web技術創建跨平臺原生桌面應用的框架。兼容Mac、Window和Linux,它構建的應用可在這三個操作系統上面運行,借助Electron,我們可以使用純JavaScript來調用豐富的原生APIs。
二、安裝步驟
1、從 Installing Node.js via package manager 安裝Node.js:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs然后再安裝Electron:
git clone https://github.com/electron/electron.git cd electron npm install electron --save-dev到這一步的時候出錯了。提示:
leon@Ubuntu:~/opensrc/electron$ npm install electron --save-dev npm ERR! Linux 4.4.0-21-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "electron" "--save-dev" npm ERR! node v6.17.1 npm ERR! npm v3.10.10 npm ERR! code ENOSELFnpm ERR! Refusing to install electron as a dependency of itself npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues>npm ERR! Please include the following file with any support request: npm ERR! /home/leon/opensrc/electron/npm-debug.log于是對package.json文件內容進行修改,把"name": “electron"改為"name”: "electron-test"即可。
再次執行即可:
# Install as a development dependency npm install electron --save-dev# Install the `electron` command globally in your $PATH sudo npm install electron -g檢查一下版本號:
electron --version v5.0.1到此,全部安裝成功!!
總結
以上是生活随笔為你收集整理的如何在64位Ubuntu16.04系统下安装electron的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: win10启动不了怎么办 win10启动
- 下一篇: 在Virtualbox下为Ubuntu1