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
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
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
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.
I am trying to install and use the rangeslider.js API, I have downloaded the latest version and I have gone about installing it via the terminal using both npm and bower install commands. When I try the npm install, i get the following error:
npm WARN checkPermissions Missing write access to /Users/Brian/node_modules
npm WARN enoent ENOENT: no such file or directory, open '/Users/Brian/package.json'
npm WARN Brian No description
npm WARN Brian No repository field.
npm WARN Brian No README data
npm WARN Brian No license field.
npm ERR! path /Users/Brian/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/Brian/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/Users/Brian/node_modules'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/Users/Brian/node_modules' }
npm ERR!
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/Brian/.npm/_logs/2017-06-30T20_40_33_877Z-debug.log
And when I try the bower install, I get this one:
bower cached https://github.com/andreruffert/rangeslider.js.git#2.3.0
bower validate 2.3.0 against https://github.com/andreruffert/rangeslider.js.git#*
bower no-json No bower.json file to save to, use bower init to create one
The last message on the bower install seems pretty clear, I need to create some sort of jSON file, but I have no idea what the requirements for it are and where I need to save it to. Can anyone help? Before you all suggest it: sudo install does not solve anything.