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

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

Related

npm elasticsearch-lite on ubuntu 22.04 and rails 7.0.4 CRUD app with react

I was having a lot of trouble with elasticsearch partially because the hard drive on my laptop is filling up I tried making space but I asked myself if maybe there was an elasticsearch lite for development environment only and then I found npm elasticsearch-lite I followed the instructions, installed it, when I run: PORT=9200 ~/node_modules/.bin/elasticsearch I get the following error, even after success running npm install wasi:
$ PORT=9200 ~/node_modules/.bin/elasticsearch
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'wasi'
Require stack:
- /home/fugee/node_modules/elasticsearch-lite/lib.elasticsearch.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at /home/fugee/node_modules/elasticsearch-lite/lib.elasticsearch.js:52:34
at Array.forEach (<anonymous>)
at /home/fugee/node_modules/elasticsearch-lite/lib.elasticsearch.js:50:53
at /home/fugee/node_modules/elasticsearch-lite/lib.elasticsearch.js:59:6
at Object.<anonymous> (/home/fugee/node_modules/elasticsearch-lite/lib.elasticsearch.js:360:2)
at Module._compile (internal/modules/cjs/loader.js:1072:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/fugee/node_modules/elasticsearch-lite/lib.elasticsearch.js'
]
}

yarn run error : Command failed with exit code 1

I was trying to follow this tutorial
This is a tutorial on Solana program dev using anchor and the error rises from using yarn on ubuntu 20.0 i guess
and I got this long error I can't understand
All the help is appreciated
yarn run v1.22.17
warning package.json: No license field
$ /home/sadaf/code/solana-twitter/node_modules/.bin/ts-mocha -p ./tsconfig.json -t 1000000 'tests/**/*.ts'
ReferenceError: TextEncoder is not defined
at Function.fromSecretKey (/home/sadaf/code/solana-twitter/node_modules/#solana/web3.js/src/keypair.ts:66:23)
at Function.local (/home/sadaf/code/solana-twitter/node_modules/#project-serum/anchor/src/nodewallet.ts:13:27)
at Function.env (/home/sadaf/code/solana-twitter/node_modules/#project-serum/anchor/src/provider.ts:79:31)
at Suite.describe (/home/sadaf/code/solana-twitter/tests/solana-twitter.ts:7:38)
at Object.create (/home/sadaf/code/solana-twitter/node_modules/mocha/lib/interfaces/common.js:148:19)
at context.describe.context.context (/home/sadaf/code/solana-twitter/node_modules/mocha/lib/interfaces/bdd.js:42:27)
at Object.<anonymous> (/home/sadaf/code/solana-twitter/tests/solana-twitter.ts:5:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module.m._compile (/home/sadaf/code/solana-twitter/node_modules/ts-node/src/index.ts:439:23)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/sadaf/code/solana-twitter/node_modules/ts-node/src/index.ts:442:12)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.implementationOfRequireOrImportForUnstableEsm [as requireOrImport] (/home/sadaf/code/solana-twitter/node_modules/mocha/lib/nodejs/esm-utils.js:116:12)
at Object.exports.loadFilesAsync (/home/sadaf/code/solana-twitter/node_modules/mocha/lib/nodejs/esm-utils.js:103:34)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Updating Node to the latest version solved it for me.

Electron w/ TensorflowJS--looking for napi-v4 but only napi-v5 present

package.json has
"#tensorflow/tfjs-node": "^1.4.0",
Here's the error:
Error: Cannot find module 'C:\Users\me\projects\myproject-desktop\project\node_modules\#tensorflow\tfjs-node\lib\napi-v4\tfjs_binding.node'
Require stack:
- C:\Users\me\projects\myproject-desktop\project\node_modules\#tensorflow\tfjs-node\dist\index.js
- C:\Users\me\projects\myproject-desktop\project\dist_electron\index.js
- C:\Users\me\projects\myproject-desktop\project\node_modules\electron\dist\resources\default_app.asar\main.js
-
at Module._resolveFilename (internal/modules/cjs/loader.js:717:15)
at Function../lib/common/reset-search-paths.ts.Module._resolveFilename (electron/js2c/browser_init.js:7609:16)
at Module._load (internal/modules/cjs/loader.js:622:27)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at Module.require (internal/modules/cjs/loader.js:775:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object.<anonymous> (C:\Users\me\projects\myproject-desktop\project\node_modules\#tensorflow\tfjs-node\dist\index.js:44:16)
at Module._compile (internal/modules/cjs/loader.js:880:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
If I go into C:\Users\me\projects\myproject-desktop\project\node_modules\#tensorflow\tfjs-node\lib\ there is a napi-v5\tfjs_binding.node but no napi-v4\tfjs_binding.node.
Do I just need to downgrade tensorflowjs? Anyone know what napi-v4 vs v5 is?
Yes you will need to downgrade tensorflowjs (while waiting for the next release).
The solution would be to use node 10.16.3 and run the command:
npm rebuild #tensorflow/tfjs-node --build-from-source

ionic serve error in mac

I'm getting following error when I'm trying to serve the ionic project.
Error: Cannot find module '/Users/SampathM/thotilla/node_modules/#ionic/app-scripts'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-utils/lib/ionic-angular/app-scripts.js:9:16)
at Generator.next (<anonymous>)
at /usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:107:75
at new Promise (<anonymous>)
at Object.__awaiter (/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:103:16)
at Object.importAppScripts (/usr/local/lib/node_modules/ionic/node_modules/#ionic/cli-utils/lib/ionic-angular/app-scripts.js:7:20)
how to resolve this?
I have had the same problem and I fix it executing :
npm i -g #ionic/app-scripts
after giving root permissions with sudo su
Hope to be helpful

Update cordova project from 3.3 to 4.x

I'm having a lot of trouble updating a cordova project from 3.3 to 4.x. The documentation says that after updating de CLI I should execute:
cordova platform update iOS
But I get this error:
Error: Cannot find module 'shelljs'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/danielrvt/.cordova/lib/npm_cache/cordova-ios/3.7.0/package/bin/update:21:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
Error: /Users/danielrvt/.cordova/lib/npm_cache/cordova-ios/3.7.0/package/bin/update: Command failed with exit code 8
at ChildProcess.whenDone (/Users/danielrvt/.nvm/v0.10.33/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
Can you help me with this update?
I had the same issue. Found solution here: https://issues.apache.org/jira/browse/CB-8036
install shelljs
cd
cd .cordova/lib/npm_cache/cordova-ios/3.7.0/package/bin
npm install shelljs
cordova plaform update ios
That worked for me
I had a similar problem. Try running the command with admin permissions (sudo).
sudo phonegap platform update ios
Then enter your password.

Resources