I recently got noticed in the Sidekick application on mac OS that a new version of the CLI was released and that I needed to update.
I quit Sidekick and run the "sudo tns i -g nativescript#latest --unsafe-perm" command in terminal with the following results:
+ nativescript#5.1.1
updated 67 packages in 14.325s
When I try to start Sidekick I get the following error:
Sidekick prompt
I head back to terminal and run "tns doctor" with the following results:
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 10.1.0 satisfies minimum required version 9.
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 5.1.0 and the latest available version is 5.1.1.
It seems like the update are not recognized by either tns doctor or Sidekick, what should I do to fix this?
Do you have nvm? This can happen when the settings in terminal are different from the global ones. For example it is possible to use one node version in the terminal and other from globally installed Sidekick.
You shouldn't use sudo - see this blog post on details on how to resolve the issue by removing the need for superuser while doing NPM installs. Similar thread here
On tns doctor command we got this message: Getting NativeScript components versions information...
This after tried to update with: sudo npm install nativescript -g --unsafe-perm
after that we got a lot of error messages.
Solved with this simply command:
tns proxy clear
then run: sudo npm install nativescript -g --unsafe-perm
Solved!
Related
I am trying to create a new React Native Project using npx. The whole
npx process is getting failed due to Ruby version. Check the attached
image for more details.
The Ruby version was already updated using
rbenv. You can see the Ruby version in the image attached.
I have
also added the necessary code to the .bash_profile and .zshrc files.
Restarted the terminal and system multiple times but the error is the
same.
I don't understand what I'm doing wrong.
First use rbenv for the ruby setup. I'll recommend to restart the system once done with the ruby setup. take help from here.
Then follow these steps to create the react native project.
1. npx react-native init testproject --skip-install
2. cd testproject
3. yarn install
4. cd ios
5. bundle install (For Intel Chip)
arch -arm64 bundle install (For M1 Chip)
6. bundle exec pod install (For Intel Chip)
arch -arm64 bundle exec pod install (For M1 Chip)
I am very new to Apple and app programming so please forgive me if I am not asking my questions in the perfect "format" that you might be expecting...
I bought my MacBook Air running on M1 chip just few days ago and would like to program with Xcode and React Native. As I do the common command "npx react-native init AwesomeProject" I got into the error which I saw quite some other people also run into:
error Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.
I tried all of the suggestions available on other posts (assuming I am understanding the remedies correctly and making the changes accordingly) but none seem to work for me.
I tried also the default suggested solution which is:
Please try again manually: "cd ./AwesomeProject/ios && pod install".
And I seem to get something different from others, which is:
Analyzing dependencies Fetching podspec for DoubleConversion from
../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec
Fetching podspec for RCT-Folly from
../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec
Fetching podspec for glog from
../node_modules/react-native/third-party-podspecs/glog.podspec
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.1/lib/ffi/library.rb:275: [BUG]
Bus Error at 0x0000000102a08000 ruby 2.6.3p62 (2019-04-16 revision
67580) [universal.arm64e-darwin20]
and then
You may have encountered a bug in the Ruby interpreter or extension
libraries.
Is it something to do with my Ruby interpreter? If yes, what are the commands I could use to solve the issue???
https://github.com/CocoaPods/CocoaPods/issues/10349#issuecomment-849468291
brew install cocoapods
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
In my case, need to restart my terminal before execute pod install. Monterey + M1.
The top answer doesn't work for me on my MBP M1 so I fixed the issue this way :
Make sure you have opened project.xcworkspace and not the project.xcodeproj
Open the workspace file with xcode with clicking on it then go to File -> Workspace Settings ... -> Build System -> Legacy Build System
Select the project file then the Target then go to Build Settings Tab and Search Paths
Double click on Library Search Paths Debug and move the $(inherited) to the bottom of the list
Do the same for the Release .
Then Build Again and you're good to go .
If you still get any errors run these commands in the ios folder of the react native project and do the above steps again and it will build successfully.
rm -rf ~/Library/Developer/Xcode/DerivedData/
pod deintegrate
pod install
If you are facing this issue in Mac Big Sur, reinstalling CommandLineTools can fix this issue.
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
When I use nvm to install a recent version of node, I have to reinstall tns. I can do that with the command npm i -g nativescript#latest. If I check tns --version I get the appropriate version. However, Nativescript Sidekick keeps telling me to run that command and will not launch. Has anyone gotten Nativescript with node to work with nvm?
I figured this out. I had to set the default node version to a lower than current version to work with Nativescript Sidekick.
nvm alias default 10.13.0
I am setting up react native on mac. I have installed node along with npm.
node version is v6.11.4
npm version is 5.4.2
I have install react native, command shown on the below image. And also export the PATH, then also it shows an error that react-native command not found. Could anyone help?
After running npm install -g react-native --verbose, it shows following:
I believe the command to get react-native-cli version is react-native -version which will show CLI version and the version of any react-native project directory you are in
I've seen this very error happening to a colleague of mine back in India. For some reason their ISP restricted the network to a level they couldn't access the NPM registry fully and the only way around it at that time was to use a VPN. Sadly I can't provide you any more info as this happened a couple of years ago.
You may want to change your DNS settings to override your ISPs' to see whether this helps but the reason why installation of react-native-cli is failing is that you can't access the NPM registry so it's a problem with your network provider rather than your machine.
I installed the composer-cli globally but it shows me error
"-bash: composer: command not found" at mac os sierra
Please make sure you did not install using sudo and that you check that the install actually worked. e.g. it will fail if you don't have XCode installed.
Yes to add to the point mentioned above.After installing Xcode it didnt work out for me . So i changed my node version from
11
to
8.8.15
and did npm install -g composer-cli. It worked for me .