LiquidPlayer / LiquidCore

Node.js virtual machine for Android and iOS
MIT License
1.01k stars 127 forks source link

zsh: parse error near `\n' #150

Closed alzin closed 4 years ago

alzin commented 4 years ago

I am getting this error when reaching this point: npm run pod-config -- --target= --podfile=

Any solution, please!!?

alzin commented 4 years ago

You can solve this by typing:

npm run pod-config -- --target='' --podfile=''

However, I am still getting the following error!

npm ERR! code EJSONPARSE npm ERR! file /Users/alzin_mohamad_ghaith/Desktop/BoxSDK/ShareData-Box/package.json npm ERR! JSON.parse Failed to parse json npm ERR! JSON.parse Unexpected end of JSON input while parsing near '...x.xcworkspace" npm ERR! JSON.parse } npm ERR! JSON.parse } npm ERR! JSON.parse ' npm ERR! JSON.parse Failed to parse package.json data. npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/alzin_mohamad_ghaith/.npm/_logs/2020-01-17T07_04_41_175Z-debug.log

I don’t know what I have to write exactly inside the pacjage.json file:

{ "name": "sharedata-box", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "server": "node node_modules/liquidcore/lib/cli.js server", "bundler": "node node_modules/liquidcore/lib/cli.js bundle", "init": "node node_modules/liquidcore/lib/cli.js init", "gradle-config": "node node_modules/liquidcore/lib/cli.js gradle", "pod-config": "node node_modules/liquidcore/lib/cli.js pod", "postinstall": "node node_modules/liquidcore/lib/cli.js postinstall" }, "author": "", "license": "ISC", "dependencies": { "liquidcore": "^0.7.1" }, "liquidcore": { "entry": [ "example.js" ], "gradle_options": { "module": "app" }, "bundler_output": { "ios": ".liquidcore/ios_bundle" }, "bundler_options": { "minify": false }, "pod_options": { "dev": true, "target": "ShareData-Box.xcworkspace" } }

ericwlange commented 4 years ago

Hi @alzin, the command would be, probably:

npm run pod-config -- --target=ShareData-Box --podfile=Podfile

assuming your Podfile is in the root directory. Leave off the .xcworkspace.

I think you might be missing a closing } at the end of your JSON file.

BUT, and this is important, see issue #149 . iOS is not working right now. I can't figure out how to publish the pod spec. It fails validation. I need to solve this issue before any of this will work.

ericwlange commented 4 years ago

Also, and maybe I need to make this clearer in the instructions, you do not have to edit your package.json file. pod-config will take care of it. The only time you need to edit it is if you want to add/change the entry file to get packaged (by default it packages example.js, you will most likely want to change that), or if you have a non-standard config. Otherwise you shouldn't have to touch it.

alzin commented 4 years ago

Thank you very much for your feedback.

I just tried it as you mentioned like this,

npm run pod-config -- --target=ShareData-Box --podfile=Podfile

sharedata-box@1.0.0 pod-config /Users/alzin_mohamad_ghaith/Desktop/BoxSDK/ShareData-Box node node_modules/liquidcore/lib/cli.js pod "--target=ShareData-Box" "--podfile=Podfile"

And the shell printed this response,

Updated /Users/alzin_mohamad_ghaith/Desktop/BoxSDK/ShareData-Box/Podfile Pod config complete Created /Users/alzin_mohamad_ghaith/Desktop/BoxSDK/ShareData-Box/.liquidcore/liquidcore_bundle.podspec Saved pod_options in package.json

And as you said it edits inside the package.json file automatically, and here is inside it:

{ "name": "sharedata-box", "version": "1.0.0", "description": "", "main": "example.js", "dependencies": { "liquidcore": "^0.7.1" }, "devDependencies": {}, "scripts": { "server": "node node_modules/liquidcore/lib/cli.js server", "bundler": "node node_modules/liquidcore/lib/cli.js bundle", "init": "node node_modules/liquidcore/lib/cli.js init", "gradle-config": "node node_modules/liquidcore/lib/cli.js gradle", "pod-config": "node node_modules/liquidcore/lib/cli.js pod", "postinstall": "node node_modules/liquidcore/lib/cli.js postinstall" }, "author": "", "license": "ISC", "liquidcore": { "entry": [ "example.js" ], "pod_options": { "target": "ShareData-Box", "podfile": "Podfile" }, "bundler_output": { "ios": ".liquidcore/ios_bundle" } } }