Building electron app fails with Electron packager and electron builder - electron

First of all, I created a tag and build my app with electron-packager:
node_modules/.bin/electron-packager . MyApp --platform=win32 --arch=x64 --icon='/home/user/Desktop/logo.ico' --asar=true --prune --overwrite
It worked fine! The problem is that now, for this release, I create a new tag, but I try to build my app with electron builder instead. I get the following error:
A JavaScript error occurred in the main process Uncaught Exception:
Error: Unable to find a valid app at Object.<anonymous> (E:\Project\dist\win-unpacke
d\resources\electron.asar\browser\init.js:128:9) at Module._compile (module.js:541:3
2) at Object.Module._extensions..js (module.js:550:10) at Module.load (module.js:458
:32) at tryModuleLoad(module.js:417:12) at Function.Module._load (module.js:409:3) a
t Function.Module.runMain (module.js:575:10) at run (bootstrap_node.js:360:7) at sta
rtup (bootstrap_node.js:152:9) at bootstrap_node.js:497:3
Furthermore, I try to build my app again with electron packager, but it didn't work now! I get the same problem.
I checkout my app to the previoulsy working tag, and it neither work.
Unfortunately, the code can not be distributed
Thanks!

The problem was in my package.json.
I miss to add "package.json" file to my files field

Related

Openshift build fails only in a specific project (with meteor error)

Using Openshift 4.6.
I'm trying to build an image with a buildConfig, a docker strategy from a binary source (local directory). The buildConfig is generated with the command:
oc new-build . name=build-name --strategy=docker --to=registry-url/image-name:tag --push-secret=secret-name --to-docker.
The build is started with the command:
oc start-build build-name --from-dir=. --wait --follow
The base image is pulled properly and the local Dockerfile starts executing. The dockerfile involves usage of meteor command, and it's okay as the base image contains meteor in /root directory and I'm running everything with --allow-superuser.
When running any meteor command (even --version), the build fails with:
## There is an issue with `node-fibers` ##
`/root/.meteor/packages/meteor-tool/.2.2.0.1jauib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/bin/linux-x64-57-glibc/fibers.node` is missing.
Try running this to fix the issue: /root/.meteor/packages/meteor-tool/.2.2.0.1jauib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node /root/.meteor/packages/meteor-tool/.2.2.0.1jauib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/build
SyntaxError: Invalid regular expression
Error: Missing binary. See message above.
at Object.<anonymous> (/root/.meteor/packages/meteor-tool/.2.2.0.1jauib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/fibers.js:20:8)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/opt/meteor/dist/bundle/programs/server/boot.js:1:75)
at Module._compile (module.js:635:30)
The file fibers.node definitely exists, as when I run in the Dockerfile echo $(ls -la ) it prints fibers.node.
To complicate things more, this problem only occurs when building in a specific project (namespace). When running the same buildConfig, with same secrets, in different projects it works well. Unfortunately, I need this project.
What can be the cause of faulty build in a specific namespace? Otherwise, there are no problen with it and it has more than sufficient resources and limits

XCode 12 - Command PhaseScriptExecution failed with a nonzero exit code

Edit: Just created a brand new project, (npx react-native-init), still the same exact issue. No clue what's happening, never had this issue before.
App is building / running file locally. It's only when I archive this issue pops up.
Tried:
Deleting pod file / workspace
Checking 'For install builds only'
Disable / Enable the 'login' in 'Keychain Access'
Cleaning and restarting computer
Archiving in debug and release
Node: 14.16.1 / RN: 0.64.0 / Typescript
What else should I do? Really stuck here. It doesn't make sense it builds fine locally but not in Archive. Thank you.
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/andrewyoung/tacapp/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/doctor/doctor.js:28:21)
Command PhaseScriptExecution failed with a nonzero exit code
Got it - Per this article I used: nvm unalias default and my app is now running.

firebase function https post - Error: Cannot find module 'request' problem

I am trying to do a https post in firebase function, and I tried to deploy the code below but it had problems with "request". I would like to know how to solve the issue below and do a https post.
Deployment error.
Function failed on loading user code. Error message: Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module 'request'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/srv/index.js:36:15)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
I have executed this on command line, but I dont see any request module in package.json
npm install --save request
The following is my firebase function code
https://gist.github.com/axilaris/378a4a3b344b22ed09d6ed6b1ec4b14f
If you don't see the request module in your package.json, that means you probably ran the npm command in the wrong folder. You should run it from your "functions" folder, where package.json lives.

yarn run ios - Error: Cannot find module - React Native

So, I'm setting up new React Native project, and I'm trying to setup XCode simulator. I've opened my React Native project in XCode and in the terminal when I run "yarn run ios" from a project folder I'm getting the error "Error: Cannot find module '#babel/runtime/helpers/interopRequireDefault'
at Function.Module._resolveFilename".
My-MacBook-Pro-2:projectZero alexs$ yarn run ios
yarn run v1.13.0
$ react-native run-ios
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module '#babel/runtime/helpers/interopRequireDefault'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/Users/alexs/Desktop/React/Native/projectZero/node_modules/react-native/local-cli/cliEntry.js:11:41)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Module._compile (/Users/alexs/Desktop/React/Native/projectZero/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Object.newLoader [as .js] (/Users/alexs/Desktop/React/Native/projectZero/node_modules/pirates/lib/index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:599:32)
error Command failed with exit code 1.
Does anybody have an idea how to solve this?
I solved it by running:
yarn add #babel/runtime

errors when building zepto

when I try to build zepto I get the following error:
MODULES="zepto event polyfill detect fx fx_methods ajax form selector touch gesture" ./make dist
Error: Cannot find module 'shelljs/make'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/Users/kevin/etcgit/zepto/make:4:3)
at Object.<anonymous> (/Users/kevin/etcgit/zepto/make:153:4)
at Module._compile (module.js:449:26)
at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:124:25)
at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:166:29)
at fs.stat.notSources.(anonymous function) (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:141:18)
at fs.readFile (fs.js:176:14)
at Object.oncomplete (fs.js:297:15)
not sure whats going on... I did install shell js but that didnt get rid of the error...
Make sure you run npm install first. So...
cd src/js/libs/zepto
npm install
MODULES="zepto event polyfill detect fx fx_methods ajax form selector touch gesture" ./make dist
From https://github.com/madrobby/zepto#building
I ran into the same problem myself...
Good luck,
Rob.
If you want to custom package,please open the file 'make' in the zepto root directoy and find the line 42.Then you will see:
modules = (env['MODULES'] || 'zepto event ajax form ie touch').split(' ')
Modify the package that split with space, after save it. Run the
npm run-script dist
In previous,you must have installed all the packages that depended on.

Resources