I'm having issues setting up React-Native on windows 8.1. I have installed react native with the npm install -g react-native-cli yet when I execute react-native init Myproject I get react-native: command not found. I'm using an elevated Powershell so this is rather frustrating. Need your help
You need to add the global npm directory to your path, which the Windows installer for current NodeJS Long Term Support release (6.10.x) should have done automatically. I'd recommend uninstalling nodejs, and then reinstalling latest LTS release. That should add the path for you automatically, I just verified as such in a Windows 7 virtual machine.
If that didn't add the path for some reason, you can do it manually from the System control panel.
Related
I am making an application using ElectronJS and I am facing an issue.
FYI: I am using electron-react-boilerplate for my application. And I use a npm library called iohook to catch all the system inputs like key pressed etc..
So, I create ".deb" file for my linux using:
npm run package --linux
After this, I install the generated file using
sudo apt install ./fileName
Now, when I try to open this installed application by clicking on it it does not open. But when I comment all the code in "main.ts" file which is related to "iohook" and then create a build and install the application in system it opens up perfectly.
So, the main issue is the "iohook" library is not running in the production environment but runs perfectly in the development. What should I do to make it run in production as well?
Electron version: 8.5.2
iohook version: ^0.9.3
I cannot use higher(or latest) version of Electron or else I get issues because of version incompatibility.
Edit: Here is the link to the project repo
https://gitlab.com/vgoyal23/electron-apps
Found the answer in the issue below. I had to add iohook not just to /package.json but also in the /release/app/package.json.
Refer this issue https://github.com/wilix-team/iohook/issues/414
I have experience developing ReactJS apps on Windows (with VSCode and Git/Sourcetree), but I have never used Linux/Mac.
Now I'm going to work (temporarily) with a team who are working on a huge/mature ReactJS project. The problem is they're all on Linux and Mac (they use Git too).
I am hoping to be able to just use my Sourcetree and VSCode and everything on Windows, but I imagine at least the scripts in their package.json won't easily run on my Windows machine?
If anyone has faced a similar situation I would really appreciate some advice so I could prepare.
To work on a project developed on Linux, and make Linux commands from the package.json scripts run on Visual Studio Code on Windows:
Install Git for Windows
Set VSCode to use Bash
Run this command to make npm scripts run in Bash:
npm config set script-shell
"C:\Users\hardi.sempuno\AppData\Local\Programs\Git\bin\bash.exe"
(To undo this: npm config delete script-shell)
I am currently pretty lost where to start searching for the error that I am facing. The same AngularJS project that my colleagues have been working on for quite a while on Macs cannot be compiled correctly on my Windows machine. No idea if windows and mac has anything to do with the error but just in case I am adding this information.
I've checked out the project with SourceTree and opend it with WebStorm.
First npm install then gulp dev in the terminal of WebStorm and my angularJs-project is beeing compiled without any errors. When then the browser windows with //localhost is beeing opened, the page shows shortly the loading anymation and then stays blank.
In the attached screenshot you can see the output of the console. Any ideas?
AngularJS Version: 1.7.2
NPM Version: 5.6.0
Gulp:
CLI version 3.9.1
Local version 3.9.1
What could make the difference that the project is running perfectly on other machines but not on mine?
[Edit]:
I have now reanimated my old macbook, checked out the exact same project with source tree, installed webstorm, ran npm install, then doing this to set up gulp and then running gulp dev: The App runs just fine.
On my Windows Laptop I've started all over, deinstalled WebStorm, deinstalled node.js and did the whole set up as described above. Only difference that I need to install node.js manually on Windows to use npm.... same error as described before.
I am trying to install an app with react native cli but get the
ERROR: JAVA_HOME is not set and no 'java' command could be found in
your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation. Could not install the app on the
device, read the error above for details. Make sure you have an
Android emulator running or a device connected and have set up your
Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
error...
And frankly this is sooo ofrustrating... Never had an issue with ionic or cordova nor android studio but infortunally, I need some native functions for my app...
Here is a background, at first the app was installing, I even was able to run hot reload on it then out of nowhere, without any change on the computer, I get this message whenever I try :react-native run-android".... I followed exactly what's on facebook github page but got this error... So i tried running a simple app on android studio and it worked...
Can someone have solution and also why this is happening out of nowhere?
Oh, I forgot right before I got this error, for some reason, I had to reinstall npm because nodeJs was not recognizing the npm command anymore
Ps : I even uninstall then reinstall android studio, uninstalled react-native-cli and reinstalling it, uninstalled react-native-create-project, reinstalled npm.
Check like this maybe this is the issue I guess:
1.Open the App that u have created using create-react-native-app or react-native init appName in android studio
It will be something like: appName>android>local properties(SDK location)
2.If u use windows pc/laptop then go to my computer right click for properties>advanced system settings click on that and find the environmental variables
and check if they are matching
Well, I got tired of it since none of the solutions on the web worked, I just wiped out my computer, reinstalled windows, got rid of all the non needed programs, reinstalled android SDK, java, react and... Still got this error... So I set JAVA_HOME (thanks youtube) and now it is working.
$ ionic run android --device
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\user\Desktop\transroads\jvdappNew\jvdApp\hooks\after_prepare\010_add_platform_class.js C:/Users/user/Desktop/transroads/jvdappNew/jvdApp
add to body class: platform-android
ERROR running one or more of the platforms: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
You may not have the required environment or OS to run this project.
It was working properly but when i updated my Android Studio there is installed another SDK also now i am having two SDK in the ANDROID_HOME path those are SDK and SDK1. SDK is having API23 and SDK1 API24.
whenever i am running command "ionic run android --device" terminal always shows that error i have discuss above.
Before update of Android Studio everything was working properly but after the update i am unable to run ionic application on my mobile device.ANDROID_HOME path is C:\Users\user\AppData\Local\Android\sdk; and i am having SDK1 folder also after the Android Studios updation on that location.
AVD Manager.exe and SDK Manager.exe those files are only in SDK and SDK1 having nothing like that.Please help me out of this.
Anyone please tell me both the platform can run over a SDK Manager?
You need to update your cordova android platform. Basically the older version till 6.2.0 used android command which is deprecated in the SDK.This was patched in 6.2.0
Check this answer for more info.
Update your cordova cli first:
npm install -g cordova#latest
You can update to the latest platform by doing:
ionic platform add android#6.2.3
Or
ionic platform add android#latest
For IONIC CLI v3 the command is:
ionic cordova platform add android#latest