No such file or directory appcenter.podspec.json in CocoaPods/CocoaPods - react-native-ios

trying to install Microsoft Appcenter for react-native iOS. I got this error:
We couldn’t find any issues matching 'No such file or directory # rb_sysopen - /Users/userName/Documents/Repo/bookombo-app-new/ios/Pods/Local Podspecs/appcenter.podspec.json' in CocoaPods/CocoaPods' after running Pod install since Updating react-native to 0.60.
"appcenter": "2.4.0",
"react-native": "0.60.6",

I solved this by making appcenter-pre-build.sh
and
only adding these two lines
gem uninstall cocoapods
gem install cocoapods -v 1.7.5

Run the following cmds
yarn remove appcenter appcenter-crashes
cd ios && pod install && cd ..
yarn add appcenter appcenter-crashes
cd ios && pod install && cd ..

Updating cocoapods to the latest version (in my case1.8) solved the problem for me :)

Related

Xcode cloud suddenly failing to link node and install dependencies

I've been trying to figure out why this xcode cloud custom scripts suddenly started failing on me yesterday since I haven't changed anything and it was working before:
#!/bin/sh
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
brew install cocoapods
# have to add node yourself
brew install node#16
# link it to the path
brew link node#16
brew install yarn
# Install dependencies you manage with CocoaPods.
yarn
pod install
# the sed command from RN cant find the file... so we have to run it ourselves
sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' /Volumes/workspace/repository/ios/Pods/RCT-Folly/folly/portability/Time.h
For some reason it has started failing with the following errors:
==> Installing node#16 dependency: brotli
==> Pouring brotli--1.0.9.monterey.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/brotli
/usr/local/include is not writable.
You can try again using:
brew link brotli
Then it keeps giving me same errors that it could not link for a few other dependencies.
When it tries to run yarn I get this:
yarn requires a Node installation to function. You can install one with:
brew install node
Assuming the node installation didn't work successfully.
Then finally this:
[in /Volumes/workspace/repository/ios]
[!] Invalid `Podfile` file: cannot load such file -- /Volumes/workspace/repository/node_modules/react-native/scripts/react_native_pods.
# from /Volumes/workspace/repository/ios/Podfile:1
# -------------------------------------------
> require_relative '../node_modules/react-native/scripts/react_native_pods'
# require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
# -------------------------------------------
sed: /Volumes/workspace/repository/ios/Pods/RCT-Folly/folly/portability/Time.h: No such file or directory
EDIT
Seems like I'm not the only one experiencing this:
https://developer.apple.com/forums/thread/712550
It seems to be an issue with the platform and not by my config apparently.
Changing the macOS version (in Workflow environment settings) from "Latest release" to 12.4 could help.
I managed to find a workaround by installing node from the .tar.gz from node website:
NODE_VER=16
VERSION=$(curl -s https://nodejs.org/dist/latest-v$NODE_VER.x/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')
if [[ "$(arch)" == "arm64" ]]
then
ARCH="arm64"
else
ARCH="x64"
fi
curl "https://nodejs.org/dist/latest-v$NODE_VER.x/node-$VERSION-darwin-$ARCH.tar.gz" -o $HOME/Downloads/node.tar.gz
tar -xf "$HOME/Downloads/node.tar.gz"
NODE_PATH="$PWD/node-$VERSION-darwin-$ARCH/bin"
PATH+=":$NODE_PATH"
export PATH
node -v
npm -v
also: If you need node to build a react native app you need to generate ios/.xcode.env.local so it exports $NODE_BINARY:
echo "export NODE_BINARY=$(which node)" > ../.xcode.env.local
Good luck!

Create-react-app returns "Cannot find module 'rxjs'"

I've just installed NodeJS and NPM in a new machine. I added rxjs package in all my existing projects in order to make then start properly. However, when I run create-react-app - using npm globally or npx - I receive "Error: Cannot find module 'rxjs'
". Seems like rxjs is a new dependency of something (considering it's affecting old projects too).
I have already changed Node version to 8, 10 and 12. Reinstalled NPM, changed CRA version to 2.x.x and the trouble persists.
How can I use CRA without this problem?
As mentioned by the Original Poster in the comments, the fix could be to clear your cache.
npm cache clean --force
If this still doesn't work, you can follow the steps below to install and try with Yarn:
If neither npx create-react-app my-app and npm init react-app my-app are working for you, try Yarn to see how it goes.
I have used CRA is multiple projects on Windows, Ubuntu, Mint and macOS and have never explicitly installed rxjs, nor have I been asked for it. This leads me to think that this problem is almost certainly caused by sth local to you rather than sth wrong with CRA. I assume that you have searched through their issues on Github.
Try it with Yarn
Open a new terminal (linux and macOS) or command line (Windows) session cd'd to your documents folder or suitable alternative. Then run:
macOS
brew install yarn
yarn create react-app my-app
Windows (with Chocolatey)
choco install yarn
yarn create react-app my-app
Ubuntu
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
yarn create react-app my-app

Jenkins is not installing some node dependencies

I'm running a nodejs application's build on jenkins. I run node as shell script step, because I have some limitations in terms of the plugins I can install in this jenkins instance.
This is what the npm install step looks like:
#!/bin/bash +x
source ~/.bashrc
cd $WORKSPACE/ && \
nvm use 7.8.0 && node --version && npm install
The problem I have is, when npm install finishes, it doesn't install everything. If I ssh into the box where jenkins is installed and run npm install inside that project's workspace, with the same user jenkins uses, it works ok. Any ideas?
EDIT
I just realized the dependencies that it's not installing are devDependencies
The problem was I had the node env set to production, and of course, it wouldn't get the devDependencies...

env: node: No such file or directory in mac

I'm searching it in google on how to show the version of node js or how I'm gonna work with npm?
If I do this
npm -v
even I already install it using brew install node. The result is always
env: node: No such file or directory
I already do a lot of command to solve for it, but failed.
these are the command that I already try:
sudo apt-get install nodejs-legacy
sudo ln -s /usr/local/bin/node /usr/bin/node
brew unlink node
brew link node
I can't start the task because of this. help me guys. This work before after I used this command brew link --overwrite node. Now I have problem, i cant work anymore with npm. I'm really new about this. I don't have any idea now on how to fix this.
Update
I already get the list using npm list command. I also get the idea here link but when I npm install inside the project. I alwayst get this "result env: node: No such file or directory",even I command npm -v but If i command it outside my project. It work the npm -v
I solved it this way:
$ brew uninstall --force node
$ brew uninstall --force npm
after it
$ brew install node
which suggested me to overwrite simlinks
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/doc/node/gdbinit
Target /usr/local/share/doc/node/gdbinit
already exists. You may want to remove it:
rm '/usr/local/share/doc/node/gdbinit'
To force the link and overwrite all conflicting files:
brew link --overwrite node
after executing
$ brew link --overwrite node
everything worked again.
NOTE: Only mac users!
uninstall node completely with the commands
curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
Or you could check out this website: How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
if this doesn't work, you need to remove node via control panel or any other method. As long as it gets removed.
Install node via this website: https://nodejs.org/en/download/
If you use nvm, you can use:
nvm install node
You can already check if it works, then you don't need to take the following steps with: npm -v and then node -v
if you have nvm installed:
command -v nvm
Uninstall npm using the following command:
sudo npm uninstall npm -g
Or, if that fails, get the npm source code, and do:
sudo make uninstall
If you have nvm installed, then use: nvm uninstall npm
Install npm using the following command: npm install -g grunt
I was getting this env: node: No such file or directory error when running the job through Jenkins.
What I did to fix it - added export PATH="$PATH:"/usr/local/bin/ at the beginning of the script that Jenkins job executes.
If you're switching from bash to oh my zsh, you will need to add nvm's path into the zshrc file.
#Zgpeace's answer here helped solve my issue (on IOS):
Open the .zshrc file. I used nano: nano ~/.zshrc
Add this into the file: export NVM_DIR=~/.nvm
Save changes by typing Ctrl+X --> Yes.
Reload the configuration. Type source $(brew --prefix nvm)/nvm.sh
Test by typing nvm --version.
You'll now be able to see the version. For e.g: 0.37.2
Thanks to this forum.
Sharing my notes below.
macOS Monterey
version 12.2.1
Chip Apple M1
$ brew uninstall --force node
$ brew uninstall --force npm
$ brew install node
$ brew link --overwrite node
$ brew doctor
$ brew cleanup
$ nvm --version
// 0.35.3
$ nvm use stable
// Now using node v17.6.0 (npm v8.5.1)
$ node -v
// v17.6.0
$ npm -v
// 8.5.1
I got such a problem after I upgraded my node version with brew. To fix the problem
1)run $brew doctor to check out if it is successfully installed or not
2) In case you missed clearing any node-related file before, such error log might pop up:
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built.
node
3) Now you are recommended to run brew link command to delete the original node-related files and overwrite new files - $ brew link node.
And that's it - everything works again !!!
It was nvm changing paths for me, this fixed it:
nvm use stable
I re-installed node through this link and it fixed it.
I think the issue was that I somehow got node to be in my /usr/bin instead of /usr/local/bin.
Let's see, I sorted that on a different way. in my case I had as path something like ~/.local/bin which seems that it is not the way it wants.
Try to use the full path, like /Users/tobias/.local/bin, I mean, change the PATH variable from ~/.local/bin to /Users/tobias/.local/bin or $HOME/.local/bin .
Now it works. 🙀🙀🙀
I get this error running npm start through PyCharm on Mac. For that the answer is to start PyCharm from the Terminal with open -a '/Applications/PyCharm.app/'. See https://stackoverflow.com/a/34017083/733092.
For Pycharm Professional, starting from the command line is different. Get the JetBrains Toolbox app, go to Settings, Generate Shell Script, and it will create a ~/pycharm_shell_scripts for you to run.
Working on MacOSx, maven exec not willing to execute a shell script that I could manually execute with desired result. Gave me the same error, solved it as well with
export PATH="$PATH:"/usr/local/bin/ at the beginning of the script
For mac user using the package manager homebrew:
-brew uninstall node
-brew uninstall npm
-brew doctor
-brew link node
-node -v (to check node version)
That's all you need.
For me, this error occurred when I tried to install a package with sudo npm. This fixed it:
sudo env PATH="$PATH:/usr/local/bin/" npm <rest of command>
I was using fish shell and encountered this problem on my m1 macbook air.
install nvm omf install nvm
add nvm to path by creating this file ~/.config/fish/functions/nvm.fish
I use vim so vim ~/.config/fish/functions/nvm.fish
function nvm
bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
end
install node again nvm install node
It worked for me after that, :) hopefully it does for you too
credit https://eshlox.net/2019/01/27/how-to-use-nvm-with-fish-shell
If you just installed/modified node and if intellij/webstorm or your shell is throwing this error, it's because it has not sourced the environment variables, try restarting the IDE/shell.
I also face this issue on mac. I had installed node using brew. I was able to resolve the issue by following these steps:
uninstall node using the command: brew uninstall --force node
uninstall npm using the command: brew uninstall --force npm
Then install node using the installer provided on the following link: https://nodejs.org/en/download/
Just did an update on my Mac OS which switched my .bash to /zshrc. Here is what I added to my ~/.zshrc file:
export NVM_DIR="/Users/< my name >/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # this loads nvm
Then I did a $ source ~/.zshrc and it refreshed those values.
Double checked my work with nvm --version and it was all good.
just run cmd:
% npm
before
% npx install-peerdeps --dev eslint-config-airbnb
on Mac m1 pro
Kept getting this error, found it it's because NVM wasn't using any version of node. I didn't set this but after using these commands it seemed to fix the error
nvm install lts/*
nvm use lts/*

Installation issue with Ionic

when I try to install ionic via npm I get the following issue. The installation just stops when trying to install the node-sass package. This is what I get from the command line:
npm info install node-sass#3.4.1
> node-sass#3.4.1 install /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/node-sass
> node scripts/install.js
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
The installation process just stops at this point. During installation, I've used the loglevel option to track the logs. Any ideas about what can be the cause of this error? Thanks Sandro
Hope this will help you.
if the last line of your cmd shows :
/usr/local/bin/cordova -> /usr/local/lib/node_modules/cordova/bin/cordova
then its permission issue.
sudo chown -R *username*/usr/local/lib/node_modules/cordova/
if there is any issues with node-saas
It's trying to force node-sass#3.4.1
You Can Try using npm install node-sass to get the latest version(3.4.2).
OR
When i got problems with node-saas , friend on github helped me with using libsass commands:
$ sudo rm -rf node_modules/ && cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^3.4.1"/g' package.json && npm install && ionic lib update
Where X is the version of gulp-sass in your package.json
Remove the old files in node_modules. I'm not sure is necessary to use 'sudo'
$ sudo rm -rf node_modules/
Search and replace inside package.json updating gulp-sass version to ^3.4.1. It also creates a backup (package.json.bak),
$ cat package.json | sed -i.bak 's/"gulp-sass": "^X.X.X"/"gulp-sass": "^3.4.1"/g' package.json
Reinstall dependencies
$ npm install
Update the ionic lib in the project
ionic lib update

Resources