Tried installing the CLI with the command given on the official website, this is the response :
npm install -g #aws-amplify/cli
npm WARN deprecated #types/ora#3.2.0: This is a stub types definition. ora provides its own type definitions, so you do not need this installed.
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm WARN #conduitvc/mosca#2.8.3 requires a peer of leveldown#~1.4.3 but none is installed. You must install peer dependencies yourself.
npm WARN #conduitvc/mosca#2.8.3 requires a peer of ioredis#^1.15.1 but none is installed. You must install peer dependencies yourself.
npm WARN #conduitvc/mosca#2.8.3 requires a peer of mongodb#~2.1.4 but none is installed. You must install peer dependencies yourself.
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
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 (though this is not recommended).
I have installed the latest versions of node and npm. Fixing this would be really helpful. TIA
In my case, I just had to add sudo in front of my command line request on my Mac Command Line:
sudo npm install -g #aws-amplify/cli
I was having the same issue. What worked for me was:
npm uninstall -g #aws-amplify/cli
npm install -g #aws-amplify/cli
Make sure your PC is connected to internet connection during all of this. If possible don't minimize the window, wait until everything is properly installed.
Read a blogpost on this similar error and that author suggests to install typescript, which would fix the problem. Followed that advice, installed typescript and installed aws cli and voila! it worked!. No idea how, but it fixed my problem. Curious to know how, if anyone is aware of this please let me know in your answer. TIA
sudo chown -R $USER:$(id -gn $USER) /Users/user_name/.config
Related
I've been watching tutorials and searching all over, and I've seen several similar issues on here. But none with the same errors. So I apologize if this has been answered before.
I'm taking a self-paced coding class. And I'm supposed to install sass. I finally found a tutorial that seemed straightforward. But when I entered the commands I'm getting error codes in my terminal. I'm very new to all this, so I have no idea what any of this means.
Some context: I downloaded homebrew, but didn't understand that either (so I uninstalled it). So then I Followed THIS tutorial where I downloaded node.js/npm. And everything went fine until I tried the install -g sass command. Then I started getting all these messages and going down the rabbit hole. Npmjs.com has some info on this issue, but I couldn't figure it out. It mentions reinstalling npm, or using "nvm". But when I tried the command npm install -g npm it returned very similar errors.
carlosprieto#Carloss-Mac-mini ~ % npm install -g sass
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/sass
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/sass'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/sass'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/sass'
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! /Users/carlosprieto/.npm/_logs/2022-06-17T16_02_28_018Z-debug-0.log
you need admin access, using sudo should help you
sudo npm i -g sass
this means you have superuser access, and is required to install packages globally.
read more here: https://www.tutorialspoint.com/unix_commands/sudo.htm
I used to be able to run and deploy my code using firebase. I then upgraded to the new m1 MacBook pro. I git cloned my code and made some minor changes. I tried using
firebase deploy
but I got the error message
zsh: command not found: firebase
then I tried
npm install -g firebase-tools
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated debug#4.1.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/firebase-tools/lib/bin/firebase.js
npm ERR! dest /usr/local/bin/firebase
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/lib/bin/firebase.js' -> '/usr/local/bin/firebase'
npm ERR! [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/lib/bin/firebase.js' -> '/usr/local/bin/firebase'] {
npm ERR! cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/firebase-tools/lib/bin/firebase.js' -> '/usr/local/bin/firebase'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/firebase-tools/lib/bin/firebase.js',
npm ERR! dest: '/usr/local/bin/firebase'
npm ERR! },
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/firebase-tools/lib/bin/firebase.js',
npm ERR! dest: '/usr/local/bin/firebase'
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! /Users/brennanadams/.npm/_logs/2020-12-03T18_52_42_463Z-debug.log
I looked this up on the internet but I have yet to find a solution, any help is appreciated. I am not sure if this is because I have the m1 chip and it not compatible or if a bunch of my settings reset when I upgraded. Thank you for help.
To install an npm package globally on Mac, try running with the sudo command. You'll need to enter your password.
sudo npm install -g firebase-tools
EDIT: Original title for this question asked about the request deprecation which is why I spend a paragraph explaining that's not the real problem before getting to what the real issue is and what needs to be done.
Regarding request: You don't need to do anything about that. request will continue working just fine as a dependency of firebase. Hopefully, they will replace it with something else at some point, but there's no issue to address. The deprecation of the request module was done as a proactive measure to push people to more actively-maintained and modern solutions. It wasn't because there's something fundamentally broken with request that requires people to move to something else now now now or anything like that.
Instead, your problem here is the EACCESS issue. For that, you'll want to review the npm documentation on that problem. The upshot is you probably want to reinstall Node.js with a version manager such as nvm. If you can't or don't want to do that, you can configure npm to install global packages in a directory that you have write permission to.
It worked with Yarn, Try:
yarn global add firebase-tools
export PATH="$(yarn global bin):$PATH"
command -v firebase
and firebase login will work normally
I have node 11.2.0
Keep receiving this error.
Andrews-MacBook-Pro:vueTutorial aharris$ npm install -g #vue/cli
npm WARN deprecated hoek#5.0.4: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm WARN #apollographql/apollo-upload-server#5.0.3 requires a peer of graphql#^0.13.1 but none is installed. You must install peer dependencies yourself.
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR! stack:
npm ERR! "Error: EACCES: permission denied, access '/usr/local/lib/node_modules'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/aharris/.npm/_logs/2018-11-25T18_43_42_502Z-debug.log
You are facing the problem of file permissions.
-g parameter of npm means "globally", which will install those file in the system directory, specifically in your computer /usr/local/lib/node_modules, where the owner is possibly root and with permission rwxr-xr-x, means those who is not root will have no permission to write.
Then, you may use sudo to get this permission, or just like NPM modules won't install globally without sudo said, set the npm prefix into the path where you have permissions:
$ npm config set prefix '~/.npm-packages'
All you need to do is run the same command with sudo before it,
sudo npm install -g #vue/cli
and you'll be prompted for the admin password.
When I install npm install -g ionic cordova It throws below error
npm WARN checkPermissions Missing write access to
/usr/lib/node_modules npm ERR! path /usr/lib/node_modules npm ERR!
code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error:
EACCES: permission denied, access '/usr/lib/node_modules' npm ERR! {
Error: EACCES: permission denied, access '/usr/lib/node_modules' npm
ERR! stack: 'Error: EACCES: permission denied, access
\'/usr/lib/node_modules\'', npm ERR! errno: -13, npm ERR! code:
'EACCES', npm ERR! syscall: 'access', npm ERR! path:
'/usr/lib/node_modules' } 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 (though this is not recommended).
npm ERR! A complete log of this run can be found in: npm ERR!
/home/javauser/.npm/_logs/2018-05-19T04_42_24_737Z-debug.log
I tried with root user as well.
I am using node v9.11.1 , npm 6.0.1
Never use npm with sudo (or as root)! You can create potential backdoor to your system.
I have just answered a very similar question in the following link: How to fix the problem with vue.js instalation
Basicaly what is happening is that NPM does not have the privileges to access /usr/local/lib. To give it access, you could change the ownership of ~/.npm in order to belong to your current user. This could be this way:
sudo chown -R $(whoami) ~/.npm
This way you do not have to run npm as sudo, which is not recomended. I believe that it is due to vulnerabilities that are known in npm packages.
Here is an article about it: Don't use "sudo" with npm "install"
run with sudo in Mac OS or linux
sudo npm install -g ionic cordova
or in windows open cmd with run as administrator
npm install -g ionic cordova
I first installed node and npm
Ahmads-MacBook-Pro:~ ahmadbazzi$ npm --version
5.6.0
Ahmads-MacBook-Pro:~ ahmadbazzi$ node --version
v8.9.4
Then i went to install the firebase CLI following the steps here https://firebase.google.com/docs/functions/get-started.
I first executed
Ahmads-MacBook-Pro:~ ahmadbazzi$ npm install -g firebase-tools
which gave me a whole bunch of warnings
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN checkPermissions Missing write access to /Users/ahmadbazzi/.npm-global/lib/node_modules/firebase-tools
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: #google-cloud/functions-emulator#1.0.0-alpha.23 (node_modules/firebase-tools/node_modules/#google-cloud/functions-emulator):
npm WARN 404 SKIPPING OPTIONAL DEPENDENCY: Not Found: #google-cloud/functions-emulator#1.0.0-alpha.23
and a whole bunch of errors
npm ERR! path /Users/ahmadbazzi/.npm-global/lib/node_modules/firebase-tools
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/ahmadbazzi/.npm-global/lib/node_modules/firebase-tools'
npm ERR! { Error: EACCES: permission denied, access '/Users/ahmadbazzi/.npm-global/lib/node_modules/firebase-tools'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/Users/ahmadbazzi/.npm-global/lib/node_modules/firebase-tools\'',
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/Users/ahmadbazzi/.npm-global/lib/node_modules/firebase-tools' }`
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ahmadbazzi/path to npmrc folder/_logs/2018-01-23T17_29_19_771Z-debug.log
This worked for me:
sudo npm install -g firebase-tools
Apparently the installation requires superuser privileges, which you can request with sudo.
Try a variety of things:
Try repeatedly to uninstall and reinstall. Sometimes the problem can clear itself up.
npm uninstall -g firebase-tools; npm install -g firebase-tools
Check the specific permissions on the files in the error message. Do you have write access to them? If you don't, do you perhaps need to use sudo to write them?
Completely blow away the location where it's trying to install, which is apparently /Users/ahmadbazzi/.npm-global for you.
This worked for me, try:
npm i firebase --save --force