"This site can't be reached" error coming while trying to open DevTools from my node-webkit app

Viewed 595

I have created a very simple "Hello World" app using node web-kit. I try to open devtools on launching the app, using

require('nw.gui').Window.get().showDevTools(); 

in index.html file. But when it gets opened, it shows error as [enter image description here]1

My index.html looks like this:

<!DOCTYPE html>
<html>
  <head>
    <title>Hello World!</title>
  </head>
  <body>
    <h1>Hello World!</h1>
    We are using node.js 
 <script>
 document.write(process.version);
 require('nw.gui').Window.get().showDevTools();
 </script>
  </body>
</html>

package.json is:

{
  "name": "nw-demo",
  "version": "0.0.1",
  "main": "index.html"
}

My node-webkit app opens like this: enter image description here

Please suggest how to fix this error of devtools.

NOTE: Earlier I was using latest version of nwjs-v0.44.4. However, on switching to older version of nwjs-v0.20.0, I am able to open devtools. So now the problem is, why in newer versions, devtools can't be opened?

1 Answers

You might have run the normal version of NW.js. If that's the case, download the SDK version of NW.js from https://nwjs.io/downloads/ and try again.

Related