How to open node-webkit application to open it correctly?

I am working on setting up my first node-webkit application and I am having trouble running it. I am on a Mac and the application file structure looks the same as shown below.

Folder
 index.html
 package.json

Package.json

{
  "name": "Test App",
  "main": "index.html",
  "window": {
    "toolbar": true,
    "width": 800,
    "height": 600
  }
}

Then I ran the "zip data" in the terminal to pin the application and rename the zip file to "app.nw".

When I drag the nw file or the source folder to node -webkit, it does not open my application correctly, instead it displays the default screen.

enter image description here

+4
source share
3 answers

, , -, , , . , , , , , , .:)

, nodewebkit :

$ sudo npm install -g nodewebkit

, , , package.json, :

$ nodewebkit .

, , ! node -webkit , Kathy Sierra, , .

Gaze. , node -webkit . zip, , , , zip, run, test cycle, .

, , . , , -, , "npm +", ", - , A B. , !

+12

, , - node webkit binary on .bash_profile

, nwjs (nwjs.app) , .bash_profile

sudo nano ~/.bash_profile

# alias to nw
alias nw="/Applications/nwjs.app/Contents/MacOS/nwjs"

bash

source ~/.bash_profile

node webkit

nw <path to your app>
+1

, .

Folder
   index.html
   package.json
   nwjs (the extract executable file)
   js
   css

nw.js, , .

: enter image description here

macOS 10.12.2 nwjs v0.19.4

0

All Articles