Module not found running npx react-native start - android

I've been wrestling with this problem of a module not being found when starting from a new or existing (ejected from expo) react-native project. After searching SO for similar problems, the errors thrown in those problems were too different for me to piece a solution from them.
Here is the command line after running the exact command:
Module not found
So overall I don't know what's really going on here. Errors are being thrown in a lot of files that are abstracted from what I usually work on.
At first, I was working with an ejected expo project but stepped away from that to start a fresh react-native CLI project following the quick start guide from the docs. I followed everything with no obvious impediment until it comes to actually executing the project.
The first thing I tried was deleting the node modules and running npm install. Note: I did not delete the package-lock.json though. I also ran a command to --force delete the cache at some point. I think I did that before I tried to delete node altogether and start from the absolute latest LTS version. During the quickstart, I ran choco install -y nodejs.install openjdk8 which installed version 16 of node and jdk8. I did already have jdk11; am I not using this kit correctly maybe?
Earlier in the day, the trace to where the error could not be found did NOT include react-native-community/cli in the path until I ran the above choco install. So it had some effect but still, nothing about the actual error changed. In the docs, it says explicitly that react-native-cli (or something like it) is packaged in with node.js so there is no need to run npm install #react-native-commmunity/cli. But, I've read conflicting solutions saying that, in fact, I do need it. Alas, installing #react-native-community/cli or react-native-cli globally had no effect.
At this point, I'm assuming the information/file I need is there but my computer is pointed to the wrong place. In the folder 'Work' there is no #react-native-community\cli\build\bin.js.
The .bin folder in node_modules: react-native files in .bin
To be honest I don't really understand these files but maybe something warrants changing? I can post a picture at request but I'm doubting a change is needed here.
Thank you for reading. Hopefully, I can get this up and running because my only avenue to meet my user stories is to manipulate the native android code.

Well, I feel silly but I learned something.
The reason the command didn't work was because one of my folders was named 'Routing&DeliveryApp'. Apparently, having an ampersand in the name will throw off the computer. So, it was cut off right after the ampersand searching in a folder named 'DeliveryApp' which did not exist.
Still felt like a eureka moment though. Hopefully this might help someone in the future.

Related

Errors when using buildozer to compile kivy/python 3.7 app into android apk on OSX - Silex & pypandoc

I've made an app using kivy and python 3.7, on OSX. It runs quite well within the PyCharm environment. However, buildozer keeps throwing up errors when I try to compile the app with buildozer.
I have installed the latest buildozer using the pip3.7 command. I have even updated python-for-android to test it out. I am also currently using the Android NDK r19c, although I have tried it with r17c and r20. Neither have worked.
Originally, I had errors relating to the use of pip, instead of pip3.7, since buildozer would try to use python 2.7 in some areas. This was solved by uninstalling buildozer etc. and reinstalling with pip3.7. Those errors have gone but at the moment, I seem to be getting new errors, related to 'Silex' and pypandoc, which is strange since I don't believe buildozer even uses those.
The error codes have too many characters to allow me to post them directly here, so please see the error codes as a page on my website. The links are below:
https://apilotslens.com/buildozer-silex-error
I then install the most recent version of Silex, which stops this error coming. However, a new error comes, relating to pypandoc:
https://apilotslens.com/buildozer-pypandoc-error
Even when I install pypandoc, the error keeps appearing.
I am very confused at this point. I have supposedly done everything by the book, so that buildozer will compile my APK. I really hope someone can help me. As far as I am aware, Buildozer doesn't even use Silex or pypandoc, so why would they be appearing? They haven't even been mentioned before. I really want to get this sorted soon.
Thanks in advance!
I'm pretty sure I haven't touched the file manually at all. The only thing I have tried is a clean: buildozer android clean but that hasn't got it working.
This only cleans the build, not the full cache. Delete /Users/JGolding/Desktop/FlightPlanningApp/PythonCode/Drafts/Draft1/.buildozer and try again.
Wait, do you mean shlex or silex?
It should read import shlex. Your file reads import silex.
Here's the link to the toolchain.py file you mentioned:
This looks good except for the shlex->silex change.
I thought I'd try uninstalling and reinstalling buildozer (pip3.7 uninstall buildozer) but interestingly, it says Can't uninstall 'buildozer'. No files were found to uninstall.
This is something unrelated arising from your pip invocation targeting the wrong directory or something.
I then install the most recent version of Silex, which stops this error coming. However, a new error comes, relating to pypandoc:
This is also unrelated, it's just that the silex module doesn't support python 3. The silex module was always a red herring, it's just the letter switch in your copy of toolchain.py that is wrong.
Note that if you read the error, it isn't complaining about pypandoc but about SyntaxError: Missing parentheses in call to 'print'..

Nativescript builds old code

I have angular 2 nativescript project and I use
tns livesync android --watch or tns run android
to see changes on both real device and emulator. It usually works fine but at some point it starts building and syncing old code and throws JS errors based on that code.
It's usually solvable by reseting the whole project (remove platforms, node-modules, hooks) and tns install everything back.
When I add new node modules and/or new custom components, I usually kill the lifesync and do the tns build android.
Regardless of this lifewatch serves old html and old js (transpiled from ts).
When I saw the output in the terminal I copied out the elements that caused an error and searched in the whole project for these elements. However they are nowhere to be found. First I thought they were still inside platforms folder, but no, so they must be cached somewhere. Has anyone noticed this as well? How to fix this / work around this ?
I am using Webstorm - tried invalidating cache and restart. Didn't help. Decided to switch over to Visual Studio Code, but it is doing the exact same thing. I have even deleted .gradle folder in order to delete cached files. Didn't help.
It seems this is fixed in next release (unfortunately not the current 2.2). Read up on their github . It was indeed the CLI syncing wrong files.

NPM not recognised, unable to install Bower (ultimately want to work with Polymer's "Material" for app development)

I'm really sorry for such a newbie question, but I've been looking through similar questions on here, and nobody seems to be getting the same error messages as myself - plus, often the questions go on a tangent too dissimilar to what I'm trying to achieve, & I end up with my head spinning in circles.
Basically, I want to work with the Polymer Project's "Material", for the purpose of practicing simple App development; however, after successfully installing npm (via Node JS), & Git, I am unable to execute even the most simple first command of
npm install -g bower
This is totally doing my head in, it seems so stupid to be unable even to install Bower. Of course, Bower is needed in order to install Polymer's Material. Am I missing something? Have I misunderstood the way in which these operations are to be carried out?
When typing in the above, all I get is:
"NPM is not recogised as an internal or external command, operable program or batch file."
Any help will be much appreciated. NB - I'll ensure that future questions are asked in the correct format (with the quotes & whatnot), but for now, pleeeease, someone tell me how to crack this nut, so I can at least get started with the programming shenanigans.
Thanks,
Simon.
You need to add NodeJS to your Path variable.
Got to Environment Variables on the System Properties and add:
;C:\Program Files\nodejs\
to the end of your Path variable.
After that, reopen your prompt and try npm again.

IntelliJ: project not generated with android tool - permission denied

I'm at a bit of a loss with this one, I'm sure it's a pretty simple problem really.
It has located the SDK and I have already installed the required build tools etc. For some reason it doesn't have permission to access the files.
I'm using ubuntu and the SDK is installed in /usr/local/android/android-sdk-linux/ . Is this as simple a problem as me placing the SDK in a bad location?
EDIT: I have fixed the issue by using the following in the command line:
chmod a+x .../tools/android
However, I'd like to know if I've removed all issues I might face in the future, and how I should actually correct this.
In case anyone else stumbles across this:
I have fixed the issue by using the following in the command line:
chmod a+x .../tools/android
Thus allowing access to the android function in the tools directory. Everything seems to be working fine now.

How to check phonegap/cordova build errors

This may be a silly question but here it goes:
I'm developing my first app with phonegap, and currently targeting android only. But this is the second time I face this problems, in my project folder, through CLI I run cordova build android, the apks were not generated.
After a LONG time debugging, and undoing my recent changes. I finally tried to compile it in Eclipse, to check if it was an android compilation error, just to find out that I have copied some test images, and the names got something copy (1).png, and android don't allow that name...
So, How do I check, from command line, the logs/errors generated by phonegap/cordova buid?
You can run the CLI in debug mode with the -d option.
cordova -d build android
This way you will get a lot more detailed report.
I'm sure you have this figured by now but just in case you, or anyone else still needs help, you may be encountering this issue because of your antivirus. I had a similar issue where when I tried to build my application. Though there were no errors being given, it was not building any APK's.
The fix for me in this situation was by temporarily disabling "Auto-Sandbox" in Comodo, (the antivirus I was using).
Hopefully this helps anyone having the same issue.

Categories

Resources