Cannot install react-native-vector-icons/Ionicons in visual studio code - react-native

I'm trying to use Ionicons in react native with vscode. But when I type the command:
npm install react-native-vector-icons/Ionicons
I receive the error:
PS C:\ReactNProjects\test230215> npm install react-native-vector-icons/Ionicons
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git#github.com/react-native-vector-icons/Ionicons.git
npm ERR! git#github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
I tried removing the nod_modules folder and tried to install again but still nog success. Does anyone have a clue?

You need to install react-native-vector-icons instead of react-native-vector-icons/Ionicons as docs. After following instructions you can simply use it by importing.

Are you sure of your npm command?
I found this command: npm install --save react-native-vector-icons
(source: https://github.com/oblador/react-native-vector-icons#installation)
And then you import react-native-vector-icons/Ionicons at the top of your js/ts file(s)

Related

How to update npm in Laravel Sail

I am currently using Laravel 8.48.2 with the Sail package. I set Sail up and running its image through Docker Desktop while using WSL 2 with a Ubuntu distro on Windows. All seems to be working fine.
After I ran sail npm install, the packages were installed successfully, but I received the following message:
npm notice New minor version of npm available! 7.18.1 -> 7.19.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.19.0
npm notice Run npm install -g npm#7.19.0 to update!
Therefore, I tried running sail npm install -g npm#7.19.0 which gave me the following message:
npm ERR! code EACCES
npm ERR! syscall rename
npm ERR! path /usr/lib/node_modules/npm
npm ERR! dest /usr/lib/node_modules/.npm-qUIFSsiV
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, rename '/usr/lib/node_modules/npm' -> '/usr/lib/node_modules/.npm-qUIFSsiV'
npm ERR! [Error: EACCES: permission denied, rename '/usr/lib/node_modules/npm' -> '/usr/lib/node_modules/.npm-qUIFSsiV'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/lib/node_modules/npm',
npm ERR! dest: '/usr/lib/node_modules/.npm-qUIFSsiV'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/sail/.npm/_logs/2021-06-26T15_27_02_291Z-debug.log
How can I update the NPM version on Sail?
Thank you in advance.
Current working method:
sail root-shell
npm install -g npm#latest
Looking at your log it seems the user you run as has insufficient permission on the folder /usr/lib/node_modules/. So what you might try is to log in to the container with docker-compose exec laravel.test bash and use chown -R user:group /usr/lib/node_modules/ with the current user and group (found by whoami). Or chmod the folder to have more looser permission overall on this folder.
Thanks to #online Thomas (https://stackoverflow.com/a/68173952/14508436), in order to resolve my issue, I followed these steps:
Within my Laravel project's directory, I ran this command... docker-compose exec laravel.test bash, which points you to the docker's server (or something like that), directly on your project's directory.
I ran this command... npm install -g npm#7.19.0 which updated npm to a newer version without any issues.
I tried the chown and chmod commands as suggested by #online Thomas, but in vain. I still couldn't use the sail npm install -g npm#7.19.0 command outside of the docker's server.

Unable to update or execute the 'expo' command in command prompt

For the first time i tried to install the expo-cli on my project directory it worked. I can use expo init to make my first react native app in my command prompt, and run the app with expo start. But now when i have some new project to make with the 'expo' command like expo init or expo start or something else, it didn't work anymore. When i tried to type and enter the expo command, its always be
'expo' is not recognized as an internal or external command, operable program or batch file.
And now when i tried to update the expo-cli with npm install -g expo-cli a warning of error appeared.
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli
npm ERR! dest C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w'
npm ERR! [Error: EPERM: operation not permitted, rename 'C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\ACER\\AppData\\Roaming\\npm\\node_modules\\expo-cli',
npm ERR! dest: 'C:\\Users\\ACER\\AppData\\Roaming\\npm\\node_modules\\.expo-cli-foqoNR8w'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ACER\AppData\Local\npm-cache\_logs\2021-01-10T17_18_03_575Z-debug.log
This preventing me from doing the installation of react navigation and make a new project by using 'expo' command. And i've been search this problem on and tried to solve it but it didn't work on any various ways that i've tried. I've tried to reinstall the expo-cli but it didn't work, i've tried to use yarn as well but still it didn't work. I've been re-added the path for the npm and even tried to reinstall nodejs and use any various code for updating and installing the 'expo-cli' but it didn't work as expected.
Any suggest on how do i can fix this problem ?
Run your command line as Admin and then do the following:
npm remove -g expo-cli to remove the existing CLI
and then npm i -g expo-cli to reinstall the Expo CLI.
Then you can simply login via expo login (if you were logged in) and take off from where you were!
I delete the expo file on the path :
C:\Users\ACER\AppData\Roaming\npm\node_modules\expo-cli
C:\Users\ACER\AppData\Roaming\npm\node_modules\.expo-cli-foqoNR8w
the file that i deleted : expo-cli & .expo-cli-foqoNR8w
And then try to install the expo-cli again with npm install --global expo-cli then it work. Now i can use my expo start or whatever code with 'expo' in it. And also now i can install react navigation on my project directory. And i'm running the installation by using command prompt run as admin.

Missing write access error on nativescript install

When I attempt to install nativescrtipt by running npm i -g nativescript, I receive the following error:
npm WARN checkPermissions Missing write access to
/usr/local/lib/node_modules/nativescript
npm ERR! path /usr/local/lib/node_modules/nativescript
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access
'/usr/local/lib/node_modules/nativescript'
npm ERR! enoent This is related to npm not being able to find a
file.
I have tried to run the command as sudo and receive the same result. I also attempted to add write permission to the node_modules directory.
I am running node v10.6.0 on macOS High Sierra.
Add sudo command to allow you run the program with security privilege
sudo npm i -g nativescript
I followed this link: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally to resolve the issue.
I installed nvm and updated to the latest version of node. Then, the command npm i -g nativescript successfully installed the nativescript-cli.
The issue does not appear to be coming from nativescript, but an issue with my node installation.
Run the following command sudo npm i -g nativescript
This will forcefully with security permission install the missing scripts to run the npm command again with no bugs or warnings

installing Vue-edit-json not working using npm

I am trying to get this https://github.com/dirkliu/vue-json-editor editor to my project and as its stated on the instructions i am running npm install Vue-edit-json --save but it gives me this error:
Timocins-MacBook-Pro:s360auth timocinzaynal$ npm install --save Vue-edit-json
npm ERR! code E404
npm ERR! 404 Not Found: Vue-edit-json#latest
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/timocinzaynal/.npm/_logs/2018-12-16T10_49_18_730Z-debug.log
Is anybody else having this problem? If not what is different with me?
The docs you linked indicate the installation command is:
npm install vue-json-editor --save
But you tried a different (and nonexistent) package name:
npm install Vue-edit-json --save
^^^^^^^^^^^^^

npm install host key verification failed

I ran npm install in angular2+ project directory and got below error which I cannot understand at all.
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\bin\git.EXE ls-remote -h -t ssh://git#bitbucket.org/path/projectname.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
I have created ssh key on bitbucket and account and saved it on drive. |
I have clone project from bitbucket.
What does this error has to do with that?
As I am new on project so don't have much knowledge.
Do I need to provide ssh key while npm install as well?
Please let me know if I can provide more info related to question.
Thanks!
Please check the npm version that you are using. Npm comes bundled with node and you shouldn't have multiple instances on your classpath.
Hey yup, I thought as much, but seeing as I had updated npm to the
latest version ( I even uninstalled node and reinstalled ) with the
same result. npm -v still showed the same version - 1.4.9.
FYI for others that may have the same issue. I also have Chocolatey
installed, and it seems that npm was also installed via Chocolately
which seems to overide the npm path. Uninstalling npm from Chocolately
resolved the npm version issue.
After that angular/cli installs correctly from npm.
https://github.com/angular/angular-cli/issues/6313#issuecomment-301360623