"../bcrypt_lib.node' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))" while running tests - macos-monterey

Error: dlopen(/Users//Documents/Work/Repo/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node, 0x0001): tried: '/Users//Documents/Work/Repo/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/Users/Documents/Work/node_modules/bcrypt/bcrypt.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Object.require.extensions.<computed> [as .js] (/Users//Documents/Work/Repo///node_modules/ts-node/src/index.ts:431:14)
any idea how to resolve this issue, new here. please let me know any additional info needed here.

I encountered a similar error and what worked for me was upgrading my node version to a higher one. I was getting the error on node version v14.16.1 but then upgraded to v16.16.0 and the issue disappeared. Also, If you are using Mac M1, maybe make sure that you are using rosetta.

In my case what worked was actually to use an older node version of Node by using NVM. That way I could use Node v14 instead of Node v16 that I had installed. It kind of makes sense as it was an app that I created some time ago and probably used Node v14 back then. Nvm is really useful to switch between Node versions.

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.

phonegap platform add ios - "Unexpected token =>" error

I have a Phonegap app and need to build it in a Mac. Everything works in a machine and I'm trying to configure a new one, but on this, when I run phonegap platform add ios I receive the following error:
$ phonegap platform add ios
/usr/local/lib/node_modules/phonegap/lib/phonegap/util/connect-proxy.js:21
fs.readFile(settings, (err, data) => {
^^
SyntaxError: Unexpected token =>
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/usr/local/lib/node_modules/phonegap/lib/phonegap/serve.js:9:23)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
Both Macs are running with node v0.12.7 and npm 2.11.3.
Apparently phonegap is using ECMAScript 6 Features like Arrow Functions.
I think this is resulting into your error, because you are still using Node v0.12.7, which does not support these features. Installing the latest LTS version from Official Node.js should fixed that.
For further information please have a look at the phonegap requirements.
Please update your node and npm version to solved your problem.

Building electron app fails with Electron packager and electron builder

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

Cannot open OSX agent

I've just installed OSX agent (to remotely build, run, and debug iOS apps created using Visual Studio Tools for Apache Cordova)
in iOS. When I want to open it (vs-mda-remote), it gives me an error:
vs-mda-remote
Copyright (C) 2014 Microsoft Corporation. All rights reserved.
0.2.7
/usr/local/lib/node_modules/vs-mda-remote/lib/cli.js:46
'lang': process.env.LANG.replace(/_.*/,""), // Convert "en_US.UTF8" to
^
TypeError: Cannot read property 'replace' of undefined
at module.exports (/usr/local/lib/node_modules/vs-mda-remote/lib/cli.js:46:33)
at Object.<anonymous> (/usr/local/lib/node_modules/vs-mda-remote/bin/vs-mda-remote:10:5)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Can anyone help me with this? Thank you very much.
After a while I found a solution.
The problem was in the node, cordova and remote agent version.
First of all I have OS X Yosemite and not Mavericks but still it works.
Don't download the newest version of the Node from nodejs.org, look for the other releases folder on the website.
1) Install node version 0.10.35;
2) cordova 4.0.0;
3) remote agent 0.2.6.
And everything should work perfectly.

Resources