React Native Linking Library - ios

I wanted to use the Native IOS search bar from https://github.com/umhan35/react-native-search-bar and when I run npm install --save (http://facebook.github.io/react-native/docs/linking-libraries-ios.html) I get error bash: library-with-native-dependencies: No such file or directory. I tried to link the library manually but it fails without showing any error. Can some one help?

I hope you did not type
npm install <library-with-native-dependencies> --save
-bash: library-with-native-dependencies: No such file or directory
In case you did, it should have been
npm install react-native-search-bar --save
If you managed to link it manually and run it, try setting a width and height for the SearchBar
.........
render(){
return (<SearchBar style={styles.searchBar} ref='searchBar' placeholder='Search'/>);
}
.........
const styles = StyleSheet.create({
searchBar:{
width: 200,
height: 40
}
});

Check whether module present in ProjectDirectory -> node_modules -> react-native-search-bar
if Not Follow Below Steps
From Your Root Directory Open package.json
Update your dependencies
Ex: Fetch from Github.
"dependencies": {
"react": "^0.14.8",
"react-native": "^0.25.1",
"react-native-search-bar": "git+https://github.com/umhan35/react-native-search-bar",
}
OR
Ex: Fetch From NPM
"dependencies": {
"react": "^0.14.8",
"react-native": "^0.25.1",
"react-native-search-bar": “^2.11.0",
}
From Terminal Change to Your Project Directory.
npm install
npm start
react-native run-ios
Then you can just import this module wherever you want to use it.
Ex: In index.ios.js
var awesomeSearchBar = require('react-native-search-bar’);

Related

stylelint giving error on iOs - Error: Could not find "stylelint-config-standard". Do you need a `configBasedir`?

It works ok on ubuntu
I installed stylelint on iOS but when I run it I get
Error: Could not find "stylelint-config-standard". Do you need a configBasedir?
My config file is:
$ cat .stylelintrc.json
{
"extends": "stylelint-config-standard",
"rules": {
"rule-empty-line-before": null,
"at-rule-empty-line-before": null
}
}
I tried "extends": ["stylelint-config-standard"],
but it didn't help
I had that error message until I installed the config
npm install stylelint-config-standard --save-dev
If you have the stylelint-config-standard dependency installed already, maybe you need to delete the node_modules folder and package-lock.json or yarn.lock if you're using yarn, and run the following command:
npm install
or with yarn
yarn install
if the stylelint-config-standard dependency isn't installed may you need to install it running:
npm install stylelint-config-standard -D
or with yarn
yarn add stylelint-config-standard -D
The solution for me was adding the overrides section to the config:
module.exports = {
overrides: [
{
files: ["**/*.scss"],
customSyntax: "postcss-scss"
}
],
rules: {...},
}
First, as tried, change the extends to be
"extends": ["stylelint-config-standard"],
but then also do npm install

SyntaxError: Cannot use import statement outside a module when run gulp server / gulp watch in my ruby project

On my ruby project when I try to run gulp (gulp server, gulp watch) I have the following error :
Users/workspace/website2019/gulpfile.babel.js:1
import del from 'del';
^^^^^^
SyntaxError: Cannot use import statement outside a module
I don't get how can I fix it, if someone could help me please,
you use babel transpilation with gulp because of the file gulpfile.babel.js For this reason you need to install babel. according to the documentation you need #babel/register and #babel/preset-env for transpiling your import syntax.
So run the following command in your project folder
npm install --save-dev #babel/core #babel/register
Afterwards create the babel configuration file .babelrc in the root folder and add the following lines to it
{
"presets": [
[
"#babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
make sure you have this line in package.json
"type": "module"

Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH. Could you tell me what the problem is?

I'm using npm install -g yo gulp to install yeoman and this is the error I'm getting
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
C:\Usr\local\gulp -> C:\Usr\local\node_modules\gulp\bin\gulp.js
C:\Usr\local\yo -> C:\Usr\local\node_modules\yo\lib\cli.js
C:\Usr\local\yo-complete -> C:\Usr\local\node_modules\yo\lib\completion\index.js
> yo#3.1.0 postinstall C:\Usr\local\node_modules\yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
√ No .bowerrc file in home directory
√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ No .yo-rc.json file in home directory
√ Node.js version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
× yo version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
√ npm version
Found potential issues on your machine :(
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\gulp\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ gulp#4.0.2
+ yo#3.1.0
updated 2 packages in 23.31s
Run the following command to see where npm puts global packages
npm config get prefix
You'll get output similar to this
/usr/local/Cellar/node/10.5.0_1
Copy the output or path and then using any code editor open your .bashrc or .zshrc file depending on the terminal you use and paste like so
export PATH="$PATH:"/usr/local/Cellar/node/10.5.0_1/bin/""
Then after saving run
source ~/.zshrc
Like Xander Cage said.
I have uninstalled node.js -> procedure here
I have restarted my PC.
Then I installed again node.js
It work.
The above didn't work for me at all.
The following solved my problem:
clean installed nodejs and followed steps by dv-here in thread: https://github.com/zkat/npx/issues/100
Note that my npm kept pointing to C:\usr...
I think I set the npm config set prefix= to something mistakenly due to which I was >getting the error. Here's how I fixed it:
Open CMD in "Administrator" mode.
npm cache clear --force
npm install
npm config set cache C:\Users\myname\AppData\Roaming\npm-cache
npm config set prefix C:\Users\myname\AppData\Roaming\npm
I just ran into this issue on MacOS, and saw that all of my global npm binaries were symlinked into the /usr/local/bin directory, except for yo. I created a symlink using this command:
ln -s /usr/local/Cellar/node/12.10.0/bin/yo /usr/local/bin/yo
(Yours may vary)
And yo is now callable.
I had same issue and I really didn't want uninstall nodejs as I have a lot of package installed.
Tried also with the second answer and did not worked.
Then I found this ticked, that is been closed:
https://github.com/yeoman/yeoman/issues/1716
install with yarn command for me worked.
yarn global add yo
Seem then the installation went through with also binary installed.
Nevermind try to install it with npm getting same error, so looking for provide more infos

Can't use react-native-svg. Xcode can't open PerformanceBezier and QuartzBookPack

I'm new to React Native and Xcode.
When I npm install react-native-svg I get the following:
Start downloading PerformanceBezier to /Users/username/AwesomeProject/node_modules/react-native-svg/ios/PerformanceBezier
Download PerformanceBezier library from github failed with err: { Error: ENOTEMPTY: directory not empty, rename '/Users/username/AwesomeProject/node_modules/react-native-svg/1511988242148-4207165471078973/PerformanceBezier-master' -> '/Users/username/AwesomeProject/node_modules/react-native-svg/ios/PerformanceBezier'
errno: -66,
code: 'ENOTEMPTY',
syscall: 'rename',
path: '/Users/username/AwesomeProject/node_modules/react-native-svg/1511988242148-4207165471078973/PerformanceBezier-master',
dest: '/Users/username/AwesomeProject/node_modules/react-native-svg/ios/PerformanceBezier' }
Download PerformanceBezier library success!
Start downloading QuartzBookPack to /Users/username/AwesomeProject/node_modules/react-native-svg/ios/QuartzBookPack
Download QuartzBookPack library from github failed with err: { Error: ENOTEMPTY: directory not empty, rename '/Users/username/AwesomeProject/node_modules/react-native-svg/1511988243034-9050633810649857/QuartzBookPack-master' -> '/Users/username/AwesomeProject/node_modules/react-native-svg/ios/QuartzBookPack'
errno: -66,
code: 'ENOTEMPTY',
syscall: 'rename',
path: '/Users/username/AwesomeProject/node_modules/react-native-svg/1511988243034-9050633810649857/QuartzBookPack-master',
dest: '/Users/username/AwesomeProject/node_modules/react-native-svg/ios/QuartzBookPack' }
Download QuartzBookPack library success!
+ react-native-svg#6.0.1-rc.0
Clearly it's having a problem, but then it says that they're both successfully installed. When I try to build the Xcode project I get an error saying that Xcode can't open either of their .xcodeproject files.
Is this something that's going wrong on my end, or is there an issue with the repos that these files are being pulled from?
I have react-native-cli: 2.0.1 and react-native: 0.50.4. and am trying to install react-native-svg#6.0.1-rc.0.
Looks like this has been reported here: https://github.com/react-native-community/react-native-svg/issues/530
Workaround is to run the following:
$ cd node_modules/react-native-svg/
$ rm -rf ios/PerformanceBezier/ ios/QuartzBookPack/
$ npm run postinstall

Change package name with bower

I want to install two versions of the same package on my components directory.
On command line I can do something like:
bower install <name>=<package>#<version>
For example:
bower install bootstrap-new=bootstrap#2.3.2
bower install bootstrap-old=bootstrap#2.0.2
Having this .bowerrc file...
{
"directory": "vendor/assets/components",
"json": "bower.json"
}
I can see 2 directories:
vendor/assets/components/bootstrap-new
vendor/assets/components/bootstrap-old
The question is: How can I do the same thing using the bower.json file?
Use the --save flag bower install --save bootstrap-new=bootstrap#2.3.2 and you should end up with this in your bower.json:
"dependencies": {
"bootstrap-new": "bootstrap#2.3.2"
}

Resources