How to include Chrome DevTools in Electron?












14















I'm still new to Electron which I'm currently following here.



I've read this page regarding on how to include the Chrome DevTools so that I can debug my application easily. I've followed the documentation but once I execute the electron <app-name> command it returns an error: The app provided is not a valid electron app, please read the docs on how to write one...



Here's the block of code from my main.js file:



var app = require('app');
var BrowserWindow = require('browser-window');

// Add Chrome DevTools extension for debugging
require('remote').require('browser-window').addDevToolsExtension('../react-devtools')


That is how my project structure looks like:



- react-devtools
- src
-- index.html
-- main.js
- package.json


Any help would be greatly appreciated. Thanks!










share|improve this question

























  • I know this question is geared towards why this error is showing up, and I am not sure if this differs from the dev tools extension, but try calling the .openDevTools() method on the BrowserWindow object you create and see if that gives you want you are looking for.

    – Shawn Rakowski
    Jun 3 '15 at 3:40
















14















I'm still new to Electron which I'm currently following here.



I've read this page regarding on how to include the Chrome DevTools so that I can debug my application easily. I've followed the documentation but once I execute the electron <app-name> command it returns an error: The app provided is not a valid electron app, please read the docs on how to write one...



Here's the block of code from my main.js file:



var app = require('app');
var BrowserWindow = require('browser-window');

// Add Chrome DevTools extension for debugging
require('remote').require('browser-window').addDevToolsExtension('../react-devtools')


That is how my project structure looks like:



- react-devtools
- src
-- index.html
-- main.js
- package.json


Any help would be greatly appreciated. Thanks!










share|improve this question

























  • I know this question is geared towards why this error is showing up, and I am not sure if this differs from the dev tools extension, but try calling the .openDevTools() method on the BrowserWindow object you create and see if that gives you want you are looking for.

    – Shawn Rakowski
    Jun 3 '15 at 3:40














14












14








14


4






I'm still new to Electron which I'm currently following here.



I've read this page regarding on how to include the Chrome DevTools so that I can debug my application easily. I've followed the documentation but once I execute the electron <app-name> command it returns an error: The app provided is not a valid electron app, please read the docs on how to write one...



Here's the block of code from my main.js file:



var app = require('app');
var BrowserWindow = require('browser-window');

// Add Chrome DevTools extension for debugging
require('remote').require('browser-window').addDevToolsExtension('../react-devtools')


That is how my project structure looks like:



- react-devtools
- src
-- index.html
-- main.js
- package.json


Any help would be greatly appreciated. Thanks!










share|improve this question
















I'm still new to Electron which I'm currently following here.



I've read this page regarding on how to include the Chrome DevTools so that I can debug my application easily. I've followed the documentation but once I execute the electron <app-name> command it returns an error: The app provided is not a valid electron app, please read the docs on how to write one...



Here's the block of code from my main.js file:



var app = require('app');
var BrowserWindow = require('browser-window');

// Add Chrome DevTools extension for debugging
require('remote').require('browser-window').addDevToolsExtension('../react-devtools')


That is how my project structure looks like:



- react-devtools
- src
-- index.html
-- main.js
- package.json


Any help would be greatly appreciated. Thanks!







electron






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 6 '15 at 19:42









Konstantin Grushetsky

72511126




72511126










asked May 18 '15 at 3:20









RenesanszRenesansz

1,04531631




1,04531631













  • I know this question is geared towards why this error is showing up, and I am not sure if this differs from the dev tools extension, but try calling the .openDevTools() method on the BrowserWindow object you create and see if that gives you want you are looking for.

    – Shawn Rakowski
    Jun 3 '15 at 3:40



















  • I know this question is geared towards why this error is showing up, and I am not sure if this differs from the dev tools extension, but try calling the .openDevTools() method on the BrowserWindow object you create and see if that gives you want you are looking for.

    – Shawn Rakowski
    Jun 3 '15 at 3:40

















I know this question is geared towards why this error is showing up, and I am not sure if this differs from the dev tools extension, but try calling the .openDevTools() method on the BrowserWindow object you create and see if that gives you want you are looking for.

– Shawn Rakowski
Jun 3 '15 at 3:40





I know this question is geared towards why this error is showing up, and I am not sure if this differs from the dev tools extension, but try calling the .openDevTools() method on the BrowserWindow object you create and see if that gives you want you are looking for.

– Shawn Rakowski
Jun 3 '15 at 3:40












6 Answers
6






active

oldest

votes


















11














So, after you've required the following:



var app = require('app');


You can use the following code (I use it in my app):



app.commandLine.appendSwitch('remote-debugging-port', '8315');
app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');


Accessing the following address allows me to debug the application in Chrome:



http://127.0.0.1:8315


I hope this helps you out. I'm also new to Electron!



If you also need to do some configurations to the underlying browser engine, please, refer to the docs.






share|improve this answer


























  • This is exactly what I was looking for!

    – Daantje
    Oct 17 '15 at 17:51











  • Good trick. For me works only with http://localhost:8315

    – doom
    Jan 16 at 11:22



















11














Maybe I am misunderstanding, but you can just do ctrl + shift + I to pull up dev tools.



Or alternatively if you are wanting to do it programmatically, the way I do it is include the following lines in my main.js file that is passed to electron.



var app = require('app');
var BrowserWindows = require('browser-window');

app.on('ready', function(){
mainWindow = new BrowserWindow({width:800, height:600});
mainWindow.webContents.openDevTools();
}


I believe part of your problem may be that you aren't waiting for the app to be ready before you try to do stuff with it.






share|improve this answer


























  • Where did you come up with Ctrl + Shift + I to open devtools?

    – pushkin
    Dec 7 '18 at 22:25











  • Oh I see - that normally works in Chrome. However, in Electron it won't. You'd need to add a listener for the shortcut. The second part of your answer is correct though

    – pushkin
    Dec 7 '18 at 23:21











  • Ctrl + Shift + I definitely still works up to Electron 2.0.0. I just double checked.

    – The Composer
    Dec 10 '18 at 19:12











  • Huh, I do not observe that behavior. Maybe my settings don't allow it...

    – pushkin
    Dec 10 '18 at 19:25



















2














you can open dev tool like this:



mainWindow = new BrowserWindow({ width: 1024, height: 768 });
mainWindow.loadURL('your url');
mainWindow.webContents.openDevTools();
mainWindow.webContents.on('devtools-opened', () => {
setImmediate(() => {
// do whatever you want to do after dev tool completely opened here
mainWindow.focus();
});
});





share|improve this answer































    0














    Most likely, Electron can't understand the path to the application folder you provided. You must provide the relative or absolute path to the application directory that holds package.json in it. E.g., if package.json file of your app is located at /home/user/my_awesome_app/package.json then in order to start the app you must issue the following command:



    electron /home/user/my_awesome_app


    Also note that main property in package.json file indicates the entry point for your application. In your case it must be like this:



     "main": "src/main.js"





    share|improve this answer


























    • Yes, I've already done that part, I was able to run my app well. The problem only occurs when I try to add the react-devtools for debugging purposes. That's when the error pops out.

      – Renesansz
      May 19 '15 at 0:56











    • What kind of error do you get when you call addDevToolsExtension?

      – Konstantin Grushetsky
      May 19 '15 at 6:51











    • The app provided is not a valid electron app, please read the docs on how to write one..blabla it appears when I add the line require('remote').require('browser-window').addDevToolsExtension('../react-devtools') You can refer to my project structure above for reference.

      – Renesansz
      May 19 '15 at 8:26











    • Oh, I did not notice one important fact first. remote module is used for remote method invocation of main process from renderer process. It doesn't work vice versa. It must be clear for you that browser-window is created in the main process and is controlled by the main process. So, in order to add React developer tools from the renderer you should issue the same command on the renderer's side (e.g., inside index.html): require('remote').require('browser-window').addDevToolsExtension('react-devt‌​ools').

      – Konstantin Grushetsky
      May 19 '15 at 9:12



















    0














    The name of the aplication is the name of the folder which contains all the tree of your aplication. So to execute you have to write, in case your folder is named Electron for example;



    electron Electron



    Always in prompt in the path that your folder is located.
    Hope this help.



    (Sorry for my english, little rusty maybe)






    share|improve this answer































      0














      Here is a Solution for Electron >= 1.2.1 version



      1- In your app folder



      npm install --save-dev electron-react-devtools


      2- Open your electron app, click on (view/toggle developer tools). In the console tab insert the following code and hit enter:



       require('electron-react-devtools').install()


      3- Reload/refresh your electron app page and you'll see the react dev tools appear.



      4- Done!





      See screen shots bellow



      Paste/type code on console tab



      hit enter



      react dev tools enabled






      share|improve this answer

























        Your Answer






        StackExchange.ifUsing("editor", function () {
        StackExchange.using("externalEditor", function () {
        StackExchange.using("snippets", function () {
        StackExchange.snippets.init();
        });
        });
        }, "code-snippets");

        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "1"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30294600%2fhow-to-include-chrome-devtools-in-electron%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        11














        So, after you've required the following:



        var app = require('app');


        You can use the following code (I use it in my app):



        app.commandLine.appendSwitch('remote-debugging-port', '8315');
        app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');


        Accessing the following address allows me to debug the application in Chrome:



        http://127.0.0.1:8315


        I hope this helps you out. I'm also new to Electron!



        If you also need to do some configurations to the underlying browser engine, please, refer to the docs.






        share|improve this answer


























        • This is exactly what I was looking for!

          – Daantje
          Oct 17 '15 at 17:51











        • Good trick. For me works only with http://localhost:8315

          – doom
          Jan 16 at 11:22
















        11














        So, after you've required the following:



        var app = require('app');


        You can use the following code (I use it in my app):



        app.commandLine.appendSwitch('remote-debugging-port', '8315');
        app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');


        Accessing the following address allows me to debug the application in Chrome:



        http://127.0.0.1:8315


        I hope this helps you out. I'm also new to Electron!



        If you also need to do some configurations to the underlying browser engine, please, refer to the docs.






        share|improve this answer


























        • This is exactly what I was looking for!

          – Daantje
          Oct 17 '15 at 17:51











        • Good trick. For me works only with http://localhost:8315

          – doom
          Jan 16 at 11:22














        11












        11








        11







        So, after you've required the following:



        var app = require('app');


        You can use the following code (I use it in my app):



        app.commandLine.appendSwitch('remote-debugging-port', '8315');
        app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');


        Accessing the following address allows me to debug the application in Chrome:



        http://127.0.0.1:8315


        I hope this helps you out. I'm also new to Electron!



        If you also need to do some configurations to the underlying browser engine, please, refer to the docs.






        share|improve this answer















        So, after you've required the following:



        var app = require('app');


        You can use the following code (I use it in my app):



        app.commandLine.appendSwitch('remote-debugging-port', '8315');
        app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');


        Accessing the following address allows me to debug the application in Chrome:



        http://127.0.0.1:8315


        I hope this helps you out. I'm also new to Electron!



        If you also need to do some configurations to the underlying browser engine, please, refer to the docs.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Aug 6 '15 at 19:34









        Konstantin Grushetsky

        72511126




        72511126










        answered Jun 4 '15 at 8:13









        aestrroaestrro

        562410




        562410













        • This is exactly what I was looking for!

          – Daantje
          Oct 17 '15 at 17:51











        • Good trick. For me works only with http://localhost:8315

          – doom
          Jan 16 at 11:22



















        • This is exactly what I was looking for!

          – Daantje
          Oct 17 '15 at 17:51











        • Good trick. For me works only with http://localhost:8315

          – doom
          Jan 16 at 11:22

















        This is exactly what I was looking for!

        – Daantje
        Oct 17 '15 at 17:51





        This is exactly what I was looking for!

        – Daantje
        Oct 17 '15 at 17:51













        Good trick. For me works only with http://localhost:8315

        – doom
        Jan 16 at 11:22





        Good trick. For me works only with http://localhost:8315

        – doom
        Jan 16 at 11:22













        11














        Maybe I am misunderstanding, but you can just do ctrl + shift + I to pull up dev tools.



        Or alternatively if you are wanting to do it programmatically, the way I do it is include the following lines in my main.js file that is passed to electron.



        var app = require('app');
        var BrowserWindows = require('browser-window');

        app.on('ready', function(){
        mainWindow = new BrowserWindow({width:800, height:600});
        mainWindow.webContents.openDevTools();
        }


        I believe part of your problem may be that you aren't waiting for the app to be ready before you try to do stuff with it.






        share|improve this answer


























        • Where did you come up with Ctrl + Shift + I to open devtools?

          – pushkin
          Dec 7 '18 at 22:25











        • Oh I see - that normally works in Chrome. However, in Electron it won't. You'd need to add a listener for the shortcut. The second part of your answer is correct though

          – pushkin
          Dec 7 '18 at 23:21











        • Ctrl + Shift + I definitely still works up to Electron 2.0.0. I just double checked.

          – The Composer
          Dec 10 '18 at 19:12











        • Huh, I do not observe that behavior. Maybe my settings don't allow it...

          – pushkin
          Dec 10 '18 at 19:25
















        11














        Maybe I am misunderstanding, but you can just do ctrl + shift + I to pull up dev tools.



        Or alternatively if you are wanting to do it programmatically, the way I do it is include the following lines in my main.js file that is passed to electron.



        var app = require('app');
        var BrowserWindows = require('browser-window');

        app.on('ready', function(){
        mainWindow = new BrowserWindow({width:800, height:600});
        mainWindow.webContents.openDevTools();
        }


        I believe part of your problem may be that you aren't waiting for the app to be ready before you try to do stuff with it.






        share|improve this answer


























        • Where did you come up with Ctrl + Shift + I to open devtools?

          – pushkin
          Dec 7 '18 at 22:25











        • Oh I see - that normally works in Chrome. However, in Electron it won't. You'd need to add a listener for the shortcut. The second part of your answer is correct though

          – pushkin
          Dec 7 '18 at 23:21











        • Ctrl + Shift + I definitely still works up to Electron 2.0.0. I just double checked.

          – The Composer
          Dec 10 '18 at 19:12











        • Huh, I do not observe that behavior. Maybe my settings don't allow it...

          – pushkin
          Dec 10 '18 at 19:25














        11












        11








        11







        Maybe I am misunderstanding, but you can just do ctrl + shift + I to pull up dev tools.



        Or alternatively if you are wanting to do it programmatically, the way I do it is include the following lines in my main.js file that is passed to electron.



        var app = require('app');
        var BrowserWindows = require('browser-window');

        app.on('ready', function(){
        mainWindow = new BrowserWindow({width:800, height:600});
        mainWindow.webContents.openDevTools();
        }


        I believe part of your problem may be that you aren't waiting for the app to be ready before you try to do stuff with it.






        share|improve this answer















        Maybe I am misunderstanding, but you can just do ctrl + shift + I to pull up dev tools.



        Or alternatively if you are wanting to do it programmatically, the way I do it is include the following lines in my main.js file that is passed to electron.



        var app = require('app');
        var BrowserWindows = require('browser-window');

        app.on('ready', function(){
        mainWindow = new BrowserWindow({width:800, height:600});
        mainWindow.webContents.openDevTools();
        }


        I believe part of your problem may be that you aren't waiting for the app to be ready before you try to do stuff with it.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Aug 7 '17 at 7:19









        Robin Andersson

        2,6491536




        2,6491536










        answered Mar 3 '16 at 19:28









        The ComposerThe Composer

        625415




        625415













        • Where did you come up with Ctrl + Shift + I to open devtools?

          – pushkin
          Dec 7 '18 at 22:25











        • Oh I see - that normally works in Chrome. However, in Electron it won't. You'd need to add a listener for the shortcut. The second part of your answer is correct though

          – pushkin
          Dec 7 '18 at 23:21











        • Ctrl + Shift + I definitely still works up to Electron 2.0.0. I just double checked.

          – The Composer
          Dec 10 '18 at 19:12











        • Huh, I do not observe that behavior. Maybe my settings don't allow it...

          – pushkin
          Dec 10 '18 at 19:25



















        • Where did you come up with Ctrl + Shift + I to open devtools?

          – pushkin
          Dec 7 '18 at 22:25











        • Oh I see - that normally works in Chrome. However, in Electron it won't. You'd need to add a listener for the shortcut. The second part of your answer is correct though

          – pushkin
          Dec 7 '18 at 23:21











        • Ctrl + Shift + I definitely still works up to Electron 2.0.0. I just double checked.

          – The Composer
          Dec 10 '18 at 19:12











        • Huh, I do not observe that behavior. Maybe my settings don't allow it...

          – pushkin
          Dec 10 '18 at 19:25

















        Where did you come up with Ctrl + Shift + I to open devtools?

        – pushkin
        Dec 7 '18 at 22:25





        Where did you come up with Ctrl + Shift + I to open devtools?

        – pushkin
        Dec 7 '18 at 22:25













        Oh I see - that normally works in Chrome. However, in Electron it won't. You'd need to add a listener for the shortcut. The second part of your answer is correct though

        – pushkin
        Dec 7 '18 at 23:21





        Oh I see - that normally works in Chrome. However, in Electron it won't. You'd need to add a listener for the shortcut. The second part of your answer is correct though

        – pushkin
        Dec 7 '18 at 23:21













        Ctrl + Shift + I definitely still works up to Electron 2.0.0. I just double checked.

        – The Composer
        Dec 10 '18 at 19:12





        Ctrl + Shift + I definitely still works up to Electron 2.0.0. I just double checked.

        – The Composer
        Dec 10 '18 at 19:12













        Huh, I do not observe that behavior. Maybe my settings don't allow it...

        – pushkin
        Dec 10 '18 at 19:25





        Huh, I do not observe that behavior. Maybe my settings don't allow it...

        – pushkin
        Dec 10 '18 at 19:25











        2














        you can open dev tool like this:



        mainWindow = new BrowserWindow({ width: 1024, height: 768 });
        mainWindow.loadURL('your url');
        mainWindow.webContents.openDevTools();
        mainWindow.webContents.on('devtools-opened', () => {
        setImmediate(() => {
        // do whatever you want to do after dev tool completely opened here
        mainWindow.focus();
        });
        });





        share|improve this answer




























          2














          you can open dev tool like this:



          mainWindow = new BrowserWindow({ width: 1024, height: 768 });
          mainWindow.loadURL('your url');
          mainWindow.webContents.openDevTools();
          mainWindow.webContents.on('devtools-opened', () => {
          setImmediate(() => {
          // do whatever you want to do after dev tool completely opened here
          mainWindow.focus();
          });
          });





          share|improve this answer


























            2












            2








            2







            you can open dev tool like this:



            mainWindow = new BrowserWindow({ width: 1024, height: 768 });
            mainWindow.loadURL('your url');
            mainWindow.webContents.openDevTools();
            mainWindow.webContents.on('devtools-opened', () => {
            setImmediate(() => {
            // do whatever you want to do after dev tool completely opened here
            mainWindow.focus();
            });
            });





            share|improve this answer













            you can open dev tool like this:



            mainWindow = new BrowserWindow({ width: 1024, height: 768 });
            mainWindow.loadURL('your url');
            mainWindow.webContents.openDevTools();
            mainWindow.webContents.on('devtools-opened', () => {
            setImmediate(() => {
            // do whatever you want to do after dev tool completely opened here
            mainWindow.focus();
            });
            });






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 14 '16 at 14:14









            BesatBesat

            839822




            839822























                0














                Most likely, Electron can't understand the path to the application folder you provided. You must provide the relative or absolute path to the application directory that holds package.json in it. E.g., if package.json file of your app is located at /home/user/my_awesome_app/package.json then in order to start the app you must issue the following command:



                electron /home/user/my_awesome_app


                Also note that main property in package.json file indicates the entry point for your application. In your case it must be like this:



                 "main": "src/main.js"





                share|improve this answer


























                • Yes, I've already done that part, I was able to run my app well. The problem only occurs when I try to add the react-devtools for debugging purposes. That's when the error pops out.

                  – Renesansz
                  May 19 '15 at 0:56











                • What kind of error do you get when you call addDevToolsExtension?

                  – Konstantin Grushetsky
                  May 19 '15 at 6:51











                • The app provided is not a valid electron app, please read the docs on how to write one..blabla it appears when I add the line require('remote').require('browser-window').addDevToolsExtension('../react-devtools') You can refer to my project structure above for reference.

                  – Renesansz
                  May 19 '15 at 8:26











                • Oh, I did not notice one important fact first. remote module is used for remote method invocation of main process from renderer process. It doesn't work vice versa. It must be clear for you that browser-window is created in the main process and is controlled by the main process. So, in order to add React developer tools from the renderer you should issue the same command on the renderer's side (e.g., inside index.html): require('remote').require('browser-window').addDevToolsExtension('react-devt‌​ools').

                  – Konstantin Grushetsky
                  May 19 '15 at 9:12
















                0














                Most likely, Electron can't understand the path to the application folder you provided. You must provide the relative or absolute path to the application directory that holds package.json in it. E.g., if package.json file of your app is located at /home/user/my_awesome_app/package.json then in order to start the app you must issue the following command:



                electron /home/user/my_awesome_app


                Also note that main property in package.json file indicates the entry point for your application. In your case it must be like this:



                 "main": "src/main.js"





                share|improve this answer


























                • Yes, I've already done that part, I was able to run my app well. The problem only occurs when I try to add the react-devtools for debugging purposes. That's when the error pops out.

                  – Renesansz
                  May 19 '15 at 0:56











                • What kind of error do you get when you call addDevToolsExtension?

                  – Konstantin Grushetsky
                  May 19 '15 at 6:51











                • The app provided is not a valid electron app, please read the docs on how to write one..blabla it appears when I add the line require('remote').require('browser-window').addDevToolsExtension('../react-devtools') You can refer to my project structure above for reference.

                  – Renesansz
                  May 19 '15 at 8:26











                • Oh, I did not notice one important fact first. remote module is used for remote method invocation of main process from renderer process. It doesn't work vice versa. It must be clear for you that browser-window is created in the main process and is controlled by the main process. So, in order to add React developer tools from the renderer you should issue the same command on the renderer's side (e.g., inside index.html): require('remote').require('browser-window').addDevToolsExtension('react-devt‌​ools').

                  – Konstantin Grushetsky
                  May 19 '15 at 9:12














                0












                0








                0







                Most likely, Electron can't understand the path to the application folder you provided. You must provide the relative or absolute path to the application directory that holds package.json in it. E.g., if package.json file of your app is located at /home/user/my_awesome_app/package.json then in order to start the app you must issue the following command:



                electron /home/user/my_awesome_app


                Also note that main property in package.json file indicates the entry point for your application. In your case it must be like this:



                 "main": "src/main.js"





                share|improve this answer















                Most likely, Electron can't understand the path to the application folder you provided. You must provide the relative or absolute path to the application directory that holds package.json in it. E.g., if package.json file of your app is located at /home/user/my_awesome_app/package.json then in order to start the app you must issue the following command:



                electron /home/user/my_awesome_app


                Also note that main property in package.json file indicates the entry point for your application. In your case it must be like this:



                 "main": "src/main.js"






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 18 '15 at 14:50

























                answered May 18 '15 at 12:53









                Konstantin GrushetskyKonstantin Grushetsky

                72511126




                72511126













                • Yes, I've already done that part, I was able to run my app well. The problem only occurs when I try to add the react-devtools for debugging purposes. That's when the error pops out.

                  – Renesansz
                  May 19 '15 at 0:56











                • What kind of error do you get when you call addDevToolsExtension?

                  – Konstantin Grushetsky
                  May 19 '15 at 6:51











                • The app provided is not a valid electron app, please read the docs on how to write one..blabla it appears when I add the line require('remote').require('browser-window').addDevToolsExtension('../react-devtools') You can refer to my project structure above for reference.

                  – Renesansz
                  May 19 '15 at 8:26











                • Oh, I did not notice one important fact first. remote module is used for remote method invocation of main process from renderer process. It doesn't work vice versa. It must be clear for you that browser-window is created in the main process and is controlled by the main process. So, in order to add React developer tools from the renderer you should issue the same command on the renderer's side (e.g., inside index.html): require('remote').require('browser-window').addDevToolsExtension('react-devt‌​ools').

                  – Konstantin Grushetsky
                  May 19 '15 at 9:12



















                • Yes, I've already done that part, I was able to run my app well. The problem only occurs when I try to add the react-devtools for debugging purposes. That's when the error pops out.

                  – Renesansz
                  May 19 '15 at 0:56











                • What kind of error do you get when you call addDevToolsExtension?

                  – Konstantin Grushetsky
                  May 19 '15 at 6:51











                • The app provided is not a valid electron app, please read the docs on how to write one..blabla it appears when I add the line require('remote').require('browser-window').addDevToolsExtension('../react-devtools') You can refer to my project structure above for reference.

                  – Renesansz
                  May 19 '15 at 8:26











                • Oh, I did not notice one important fact first. remote module is used for remote method invocation of main process from renderer process. It doesn't work vice versa. It must be clear for you that browser-window is created in the main process and is controlled by the main process. So, in order to add React developer tools from the renderer you should issue the same command on the renderer's side (e.g., inside index.html): require('remote').require('browser-window').addDevToolsExtension('react-devt‌​ools').

                  – Konstantin Grushetsky
                  May 19 '15 at 9:12

















                Yes, I've already done that part, I was able to run my app well. The problem only occurs when I try to add the react-devtools for debugging purposes. That's when the error pops out.

                – Renesansz
                May 19 '15 at 0:56





                Yes, I've already done that part, I was able to run my app well. The problem only occurs when I try to add the react-devtools for debugging purposes. That's when the error pops out.

                – Renesansz
                May 19 '15 at 0:56













                What kind of error do you get when you call addDevToolsExtension?

                – Konstantin Grushetsky
                May 19 '15 at 6:51





                What kind of error do you get when you call addDevToolsExtension?

                – Konstantin Grushetsky
                May 19 '15 at 6:51













                The app provided is not a valid electron app, please read the docs on how to write one..blabla it appears when I add the line require('remote').require('browser-window').addDevToolsExtension('../react-devtools') You can refer to my project structure above for reference.

                – Renesansz
                May 19 '15 at 8:26





                The app provided is not a valid electron app, please read the docs on how to write one..blabla it appears when I add the line require('remote').require('browser-window').addDevToolsExtension('../react-devtools') You can refer to my project structure above for reference.

                – Renesansz
                May 19 '15 at 8:26













                Oh, I did not notice one important fact first. remote module is used for remote method invocation of main process from renderer process. It doesn't work vice versa. It must be clear for you that browser-window is created in the main process and is controlled by the main process. So, in order to add React developer tools from the renderer you should issue the same command on the renderer's side (e.g., inside index.html): require('remote').require('browser-window').addDevToolsExtension('react-devt‌​ools').

                – Konstantin Grushetsky
                May 19 '15 at 9:12





                Oh, I did not notice one important fact first. remote module is used for remote method invocation of main process from renderer process. It doesn't work vice versa. It must be clear for you that browser-window is created in the main process and is controlled by the main process. So, in order to add React developer tools from the renderer you should issue the same command on the renderer's side (e.g., inside index.html): require('remote').require('browser-window').addDevToolsExtension('react-devt‌​ools').

                – Konstantin Grushetsky
                May 19 '15 at 9:12











                0














                The name of the aplication is the name of the folder which contains all the tree of your aplication. So to execute you have to write, in case your folder is named Electron for example;



                electron Electron



                Always in prompt in the path that your folder is located.
                Hope this help.



                (Sorry for my english, little rusty maybe)






                share|improve this answer




























                  0














                  The name of the aplication is the name of the folder which contains all the tree of your aplication. So to execute you have to write, in case your folder is named Electron for example;



                  electron Electron



                  Always in prompt in the path that your folder is located.
                  Hope this help.



                  (Sorry for my english, little rusty maybe)






                  share|improve this answer


























                    0












                    0








                    0







                    The name of the aplication is the name of the folder which contains all the tree of your aplication. So to execute you have to write, in case your folder is named Electron for example;



                    electron Electron



                    Always in prompt in the path that your folder is located.
                    Hope this help.



                    (Sorry for my english, little rusty maybe)






                    share|improve this answer













                    The name of the aplication is the name of the folder which contains all the tree of your aplication. So to execute you have to write, in case your folder is named Electron for example;



                    electron Electron



                    Always in prompt in the path that your folder is located.
                    Hope this help.



                    (Sorry for my english, little rusty maybe)







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 21 '15 at 8:14









                    GorthaGortha

                    1




                    1























                        0














                        Here is a Solution for Electron >= 1.2.1 version



                        1- In your app folder



                        npm install --save-dev electron-react-devtools


                        2- Open your electron app, click on (view/toggle developer tools). In the console tab insert the following code and hit enter:



                         require('electron-react-devtools').install()


                        3- Reload/refresh your electron app page and you'll see the react dev tools appear.



                        4- Done!





                        See screen shots bellow



                        Paste/type code on console tab



                        hit enter



                        react dev tools enabled






                        share|improve this answer






























                          0














                          Here is a Solution for Electron >= 1.2.1 version



                          1- In your app folder



                          npm install --save-dev electron-react-devtools


                          2- Open your electron app, click on (view/toggle developer tools). In the console tab insert the following code and hit enter:



                           require('electron-react-devtools').install()


                          3- Reload/refresh your electron app page and you'll see the react dev tools appear.



                          4- Done!





                          See screen shots bellow



                          Paste/type code on console tab



                          hit enter



                          react dev tools enabled






                          share|improve this answer




























                            0












                            0








                            0







                            Here is a Solution for Electron >= 1.2.1 version



                            1- In your app folder



                            npm install --save-dev electron-react-devtools


                            2- Open your electron app, click on (view/toggle developer tools). In the console tab insert the following code and hit enter:



                             require('electron-react-devtools').install()


                            3- Reload/refresh your electron app page and you'll see the react dev tools appear.



                            4- Done!





                            See screen shots bellow



                            Paste/type code on console tab



                            hit enter



                            react dev tools enabled






                            share|improve this answer















                            Here is a Solution for Electron >= 1.2.1 version



                            1- In your app folder



                            npm install --save-dev electron-react-devtools


                            2- Open your electron app, click on (view/toggle developer tools). In the console tab insert the following code and hit enter:



                             require('electron-react-devtools').install()


                            3- Reload/refresh your electron app page and you'll see the react dev tools appear.



                            4- Done!





                            See screen shots bellow



                            Paste/type code on console tab



                            hit enter



                            react dev tools enabled







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 15 '18 at 5:27

























                            answered Feb 14 '17 at 14:03









                            Jonca33Jonca33

                            1,1521020




                            1,1521020






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30294600%2fhow-to-include-chrome-devtools-in-electron%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Florida Star v. B. J. F.

                                Error while running script in elastic search , gateway timeout

                                Adding quotations to stringified JSON object values