Cordova build fails - android

When i run cordova run android cli it gives me this error. I am unable to find the solution on internet. cli.js is present in the src folder. I don't know what is causing the problem.
Thanks in advance
module.js:340
throw err;
^
Error: Cannot find module '../src/cli'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object.<anonymous> (C:\Users\App Metrik- Designer\AppData\Roaming\npm\cor
dova:40:11)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Function.Module.runMain (module.js:467:10)

Related

How do I fix React Native npm react-native init issue?

I write npm react-native init newApp but it returns a problem in this form.I downloaded the metro package (npm i metro) but it didn't fix the problem.Could this problem be due to missing any packages?
Error: Cannot find module './Bundler/util'
Require stack:
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\metro\src\Assets.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\metro\src\Server.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\metro\src\shared\output\bundle.flow.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\metro\src\shared\output\bundle.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli-plugin-metro\build\commands\bundle\buildBundle.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli-plugin-metro\build\commands\bundle\bundle.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli-plugin-metro\build\commands\bundle\index.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli-plugin-metro\build\commands\index.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli-plugin-metro\build\index.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\commands\index.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\index.js
- C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\#react-native-community\cli\build\bin.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
at Module._load (node:internal/modules/cjs/loader:885:27)
at Module.require (node:internal/modules/cjs/loader:1105:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (C:\Users\kamra\AppData\Local\npm-cache\_npx\7930a8670f922cdb\node_modules\metro\src\Assets.js:14:32)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Module.require (node:internal/modules/cjs/loader:1105:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\metro\\src\\Assets.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\metro\\src\\Server.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\metro\\src\\shared\\output\\bundle.flow.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\metro\\src\\shared\\output\\bundle.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\commands\\bundle\\buildBundle.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\commands\\bundle\\bundle.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\commands\\bundle\\index.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\commands\\index.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli-plugin-metro\\build\\index.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\commands\\index.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\index.js',
'C:\\Users\\kamra\\AppData\\Local\\npm-cache\\_npx\\7930a8670f922cdb\\node_modules\\#react-native-community\\cli\\build\\bin.js'
]
}
Node.js v18.13.0

How to solve this react native error?

import type {CommandT} from './commands';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Module._compile (C:\projects\splashdemo\node_modules\pirates\lib\index.js:91:24)
at Module._extensions..js (module.js:663:10)
at Object.newLoader [as .js] (C:\projects\splashdemo\node_modules\pirates\lib\index.js:96:7)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
PS C:\projects\splashdemo>
I have created this project with this command
react-native init {proj_name} --version react-native#0.55.4
Now while execute this command in my terminal, I got this issue :
react-native run-android
please suggest some solution for this

METEOR fedora "Error: EACCES: permission denied, stat" mhen y try to do "meteor add-platform android"

I cannot build my meteor app into Android.
I tried to make, but always have this error.
I tried to do meteor add-platform android, but it always gives me the following error.
Try to change the permissions of the folder to 777 and those of the .meteor and make a chown to my user to both folders but I always have the same error.
Error: EACCES: permission denied, stat
'/workspace/meteorProject/socially/.meteor/local/dev_bundle'
at Error (native)
at Object.fs.statSync (fs.js:844:18)
at statOrNull (/.meteor/packages/meteor-tool/.1.4.2_3.qtn91h++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/cli/dev-bundle.js:114:19)
at getDevBundleDir (/.meteor/packages/meteor-tool/.1.4.2_3.qtn91h++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/cli/dev-bundle.js:35:23)
at Object. (/home/epa/.meteor/packages/meteor-tool/.1.4.2_3.qtn91h++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/cli/dev-bundle.js:176:18)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

Ionic > Cannot find module 'ansi'

Building an Ionic project on a mac, throws the following error: Cannot find module 'ansi'
Command: ionic build android
Stacktrace
module.js:327
throw err;
^
Error: Cannot find module 'ansi'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/bob/myapp/platforms/android/cordova/node_modules/cordova-common/src/CordovaLogger.js:20:12)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
Error: /Users/bob/myapp/platforms/android/cordova/build: Command failed with exit code 1
N.B. Simply installing the missing module doesn't work (i.e. npm install ansi), as it complains about other missing modules...
I'm not sure why the issue occurs (maybe someone can enlighten me), but removing and re-adding the Android platform fixes the issue.
i.e.
ionic platform remove android
ionic platform add android

react-native run-android command fails

On ubuntu 14.04 I try to launch hello world project.
I get the following output when print react-native run-android
/home/jonstark/AwesomeProject/node_modules/react-native/local-cli/cli.js:73
const setupEnvScript = /^win/.test(process.platform)
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Module._extensions..js (module.js:474:10)
at Object.require.extensions.(anonymous function) [as .js] (/home/jonstark/AwesomeProject/node_modules/babel-register/lib/node.js:138:7)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/jonstark/AwesomeProject/node_modules/react-native/cli.js:15:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
What do I do to get it working?
I tried to update nodejs with sudo npm install -g n
Then node -v shows
v0.10.25
Your node version is horribly outdated. See here for steps on how to update it on Ubuntu:
https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version

Categories

Resources