-1

Trying to build electron in Ubuntu 15.10. I get a problem with the npm package being out of date. Is there a ppa for a newer electron?

$ npm install && npm start
npm WARN engine hawk@3.1.2: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine boom@2.10.1: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine cryptiles@2.0.5: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine hoek@2.16.3: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.25","npm":"1.4.21"})

2 Answers2

2

Install Node.js and npm

Node.js is available as a snap package in all currently supported versions of Ubuntu. Specific to Node.js, developers can choose from one of the currently supported releases and get regular automatic updates directly from NodeSource. Node.js versions 6, 8 and 9 are currently available, with the Snap Store being updated within hours, or minutes of a Node.js release.

Node can be installed with a single command, for example:

sudo snap install node --classic --channel 9/stable 

The node snap can be accessed by the command node, for example:

$ node -v  
v9.9.0

An up-to-date version of npm will installed as part of the node snap. npm should be run outside of the node repl, in your normal shell. After installing the node snap run the following command to enable npm update checking:

sudo chown -R $USER:$(id -gn $USER) /home/your-username/.config

Replace your-username in the above command with your own username. Then run npm -v to check if the version of npm is up-to-date. As an example I checked that npm was up-to-date, checked the version of an already installed package named yarn with the command npm list yarn and then updated the existing yarn package to the latest version with the command npm update yarn

Users can switch between versions of Node.js at any time without needing to involve additional tools like nvm (Node Version Manager), for example:

sudo snap refresh node --channel=8/stable

Users can test bleeding-edge versions of Node.js that can be installed from the latest edge channel which is currently tracking Node.js version 10 development work by switching with:

sudo snap switch node --edge

This approach is only recommended for those users who are willing to participate in testing and bug reporting upstream.


Install Electron

Electron requires a Node.js version >= 4.5, so if you have installed the node snap package you are ready to install Electron locally; just open the terminal and type:

npm install electron --save-dev --save-exact
karel
  • 114,770
1

I encountered the same problem and I updated npm to the latest version: $ npm -v 1.4.21 $ sudo npm install -g npm ... $ npm -v 3.5.3

(Weirdly, I had to sudo npm install -g npm twice to get it to work. See https://askubuntu.com/a/562432)

KDemeul
  • 11