'electron-packager' is not recognized as an internal or external command

后端 未结 6 1517
臣服心动
臣服心动 2021-02-05 16:43

I recently started using electron. I have successfully completed the 1st phase by creating a hello world app (included files index.html, main.js, package.json). Now I am trying

6条回答
  •  旧时难觅i
    2021-02-05 17:29

    Perform a global package install:

    npm install -g electron-packager
    

    The -g flag tells NPM to install the package globally which makes the command electron-packager available in your PATH.


    If you don't want to do a global install you can install it locally and run with npx.

    npm install -D electron-packager 
    
    npx electron-packager .
    

    Alternatively, you can reference it straight from the node_modules folder (not recommended).

    ./node_modules/electron-packager/cli.js
    

提交回复
热议问题