brandonjpierce / node-webkit-boilerplate

[Unmaintained]
MIT License
42 stars 11 forks source link

Invalid package.json. Field 'main' is required. #1

Open mauvm opened 10 years ago

mauvm commented 10 years ago

When executing the workflow as described in the README, I get a window that says:

Invalid package.json 
Field 'main' is required.

With a blue sky and clouds and shit.

It looks like the package.json isn't located properly..


The terminal output:

2014-04-04 15:35:07.455 node-webkit[20669:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650
2014-04-04 15:35:07.632 node-webkit Helper[20670:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650
2014-04-04 15:35:07.755 node-webkit Helper[20671:507] Internals of CFAllocator not known; out-of-memory failures via CFAllocator will not result in termination. http://crbug.com/45650

My specs are: OS X Mavericks 10.9.2, Node 0.10.25, and NPM 1.3.24.


Thanks for making a boilerplate though! (:

mauvm commented 10 years ago

FYI, paste this in your address bar for the error page:

data:text/html;charset=utf-8,%3Chtml%3E%0A%3Chead%3E%0A%3Ctitle%3ECannot%20run%20package%3C%2Ftitle%3E%0A%3Cstyle%3E%0A*%7B%20margin%3A%200%3B%20padding%3A%200%3B%7D%0A%0Abody%20%7B%0A%20%20overflow%3A%20hidden%3B%0A%7D%0A%0Ap%2C%20h1%20%7B%0A%20%20display%3A%20inline-block%3B%0A%20%20margin-left%3A%20100px%3B%0A%20%20color%3A%20%23333%3B%0A%20%20font-family%3A%20sans-serif%3B%0A%7D%0A%0A%23clouds%7B%0A%20%20padding%3A%20100px%200%3B%0A%20%20background%3A%20%23c9dbe9%3B%0A%20%20background%3A%20-webkit-linear-gradient(top%2C%20%23c9dbe9%200%25%2C%20%23fff%20100%25)%3B%0A%7D%0A%0A.cloud%20%7B%0A%20%20width%3A%20200px%3B%20height%3A%2060px%3B%0A%20%20background%3A%20%23fff%3B%0A%20%20%0A%20%20-webkit-border-radius%3A%20200px%3B%0A%20%20%0A%20%20position%3A%20relative%3B%20%0A%7D%0A%0A.cloud%3Abefore%2C%20.cloud%3Aafter%20%7B%0A%20%20content%3A%20''%3B%0A%20%20position%3A%20absolute%3B%20%0A%20%20background%3A%20%23fff%3B%0A%20%20width%3A%20100px%3B%20height%3A%2080px%3B%0A%20%20position%3A%20absolute%3B%20top%3A%20-15px%3B%20left%3A%2010px%3B%0A%20%20%0A%20%20-webkit-border-radius%3A%20100px%3B%0A%20%20-webkit-transform%3A%20rotate(30deg)%3B%0A%7D%0A%0A.cloud%3Aafter%20%7B%0A%20%20width%3A%20120px%3B%20height%3A%20120px%3B%0A%20%20top%3A%20-55px%3B%20left%3A%20auto%3B%20right%3A%2015px%3B%0A%7D%0A%0A.x1%20%7B%0A%20%20-webkit-animation%3A%20moveclouds%2030s%20linear%20infinite%3B%0A%20%20opacity%3A%200.8%3B%0A%7D%0A%0A%40-webkit-keyframes%20moveclouds%20%7B%0A%20%200%25%20%7Bmargin-left%3A%20800px%3B%7D%0A%20%20100%25%20%7Bmargin-left%3A%20-800px%3B%7D%0A%7D%0A%3C%2Fstyle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%20%20%3Cdiv%20id%3D%22clouds%22%3E%0A%20%20%20%20%3Ch1%3EInvalid%20package.json%3C%2Fh1%3E%0A%20%20%20%20%3Cbr%2F%3E%3Cbr%2F%3E%0A%20%20%20%20%3Cp%3EField%20'main'%20is%20required.%3C%2Fp%3E%0A%20%20%20%20%3Cdiv%20class%3D%22cloud%20x1%22%3E%3C%2Fdiv%3E%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A
mauvm commented 10 years ago

I've check the path ("public") that is given to the nodewebkit command, which resolves correctly. Also the package.json in the public folder does have a main field.

Also tested it with the example package.json (found on https://github.com/rogerwang/node-webkit/wiki/Manifest-format), which weirdly DOES remove the window frame.

mauvm commented 10 years ago

Seems to be a known issue in Node-Webkit: https://github.com/rogerwang/node-webkit/issues/1503.

If you rename (or remove) ./node_modules/nodewebkit/package.json it works again..

commadelimited commented 10 years ago

I can confirm that renaming/moving /usr/local/lib/node_modules/nodewebkit/package.json allows my app to start running again.