NativeScript cocoapods is not installed when using sudo - nativescript

I am trying to setup a nativescript development environment on a mac.
I installed all the dependencies including cocoapods. When I run tns doctor it all checks out, but when I run sudo -E tns doctor - it says cocoapods is not installed or is not configured correctly.
I need this to work in sudo since using npm run build:ios says I have no permission.
Any Ideas?

Whenever this happens to me I uninstall everything (tns, npm, node), and reinstall again.

Related

Unable to install packages via npm; can only use homebrew

I a trying to install some cli tools to use globally. Running the install command via npm never works - I get command not found [package] whenever I check [package] -v. I have tried this with netlify-cli, firebase-tools, and heroku.
However, when I install heroku via homebrew (brew tap heroku/brew && brew install heroku) it seemed to work fine. The version info showed up on heroku -v.
If it's relevant, I'm using MacOS 13.0, and ohmyzsh on iTerm2. I tried the built-in terminal (which also runs zsh) but had no luck.
How can I reliably use npm in order to install tools?

Flutter - 'Xcode installation is incomplete', Missing CocoaPods installation

I run flutter doctor on my Mac with Xcode 13.0 but it prompted that 'CocoaPods didn't install'.
So, I tried gem install cocoapods or sudo gem install cocoapods but it gives me Permission Error.
I also tried HomeBrew, brew install cocoapods but no luck as I run into Brew Link Error.
When I ran flutter doctor again, it gives Xcode installation is incomplete; a full installation is necessary for iOS development. Then, I deleted Xcode and CocoaPods to fresh start the installation. But it was not working.
I uninstalled HomeBrew and command line tools but it was unsuccessful.
Also, there are issues about flutter and android studio, and here is the flutter doctor output:
And here is my Android Studio project structure:
as the terminal suggests you, launch the following commands:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

On running in Ubuntu 16.04 ./createPeerAdminCard.sh it fails

composer-cli v0.19.2 was successfully installed still on running this error occurs.
Development only script for Hyperledger Fabric control
Running 'createPeerAdminCard.sh'
FABRIC_VERSION is unset, assuming hlfv11
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
No version of composer-cli has been detected, you need to install composer-cli at v0.19 or higher
The problem is that if you install composer using root or sudo then it is not available to non-root users.
The pre-reqs doc for Composer warns not to use root or sudo, but the warning is actually missing in the install doc itself.
I would recommend uninstalling composer-cli (and playground, rest-server etc) with a command like sudo npm uninstall -g composer-cli then re-install without using sudo. If you have permission problems with npm install there are some notes in the composer knowledge wiki.

Install Ionic Cordova Error

I am trying to install Ionic 2 on a OSx machine. I did install Node.js. When I run the following:
$ npm install -g ionic cordova
I get this error:
If anyone can assist, I would appreciate it.
UPDATE:
Downgraded Node to v6.9.1 and still get the same error:
UPDATE
As suggested below, I tried:
npm cache clean
But still get the same error:
UPDATE
If I try install a specific version, I get the following error:
sudo npm install -g ionic#2.0.0-beta.20 cordova
to install ionic in mac
you have to install nodejs .
to install ionic as per the official doc if you are using linux or mac you should use sudo command
try
sudo npm install -g ionic cordova
note
your npm version should be greater then 3.x
that version of node its the current so maybe its nos stable at all. I recommend to instal NVM (node version manager) from here this is like a "sand-box" where you have all node version you want and can switch between them.
You only need to run nvm install 5.11.0 and nvm will download that node version for you. Then to use a specific node version you need to run nvm use 5.11.0 and thats all.
I recommend to install 5.11.0 for example, its the node version that im using atm and its working fine with ionic2 RC3.
After downgrading your node.js clean npm cache.
npm cache clean
and try the installation again

PhoneGap Mac CLI local install failed because of Node version

So I want to debug my Phonegap webapp locally in Xcode.
I follow the step here and here, and launch in MAC CLI
$ sudo npm install -g phonegap
BUT install failed and CLI result get lots of errors with the first one is :
engine phonegap#2.9.0rc1-0.12.0: wanted: {"node":">=0.10.0"} (current: {"node":"v0.8.8","npm":"1.1.59"})
I understand my node version is too old : 0.8.8
node --version
I try to update but I am stuck with those 2 methods here and both in errors for me :
BREW
Tried Homebrew but did not work :
$ brew upgrade node
Error: node-0.8.8 already installed
NPM
As I found here
Upgrading Node.js to latest version
How do I update Node.js?
$ sudo npm install -g n
$ sudo n stable
sudo: n: command not found
In fact my bash_profile was missing the path to the n module as I found here:
cannot install npm? problems generating application
Edit your ~/.bash_profile. Add this export somewhere.
export PATH=/usr/local/bin:$PATH:/usr/local/share/npm/bin
I had the same issue and fixed it by upgrading node with brew, I just run
brew install --upgrade node

Resources