npm update firebase-admin fails with ENOENT: no such file or directory, rename
See original GitHub issueI think I have the same issue as posted here for NPM. However, I have not had this issue with any other packages, so I think the problem is firebase-admin version 5.4.3 (version 5.4.2 works fine), not NPM.
System info
Mac OS: 10.12.6 Node: 8.6.0 NPM: 5.5.1 firebase-admin: 5.4.2 -> 5.4.3 Installed NPM Packages:
@ google-cloud/storage@1.4.0 @ types/fs-extra@4.0.3 child-process-promise@2.2.1 cloudconvert@1.1.2 firebase-admin@5.4.2 firebase-functions@0.7.1 fs-extra@4.0.2 lodash@4.17.4 mailgun-js@0.13.1 mime@1.4.1 ringcentral@3.1.3 typescript@2.5.3
Install Error
Running npm update
gives this error:
npm ERR! path /Users/Username/Sites/Sitename/functions/node_modules/firebase-admin/node_modules/grpc/node_modules/abbrev
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/Username/Sites/Sitename/node_modules/firebase-admin/node_modules/grpc/node_modules/abbrev' -> '/Users/Username/Sites/Sitename/node_modules/firebase-admin/node_modules/grpc/node_modules/.abbrev.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Username/.npm/_logs/2017-10-25T01_25_07_312Z-debug.log
And here’s the relevant part of the log file:
8231 verbose unlock done using /Users/Username/.npm/_locks/staging-e6d3ce262201f329.lock for /Users/Username/Sites/Sitename/node_modules/.staging
8232 verbose stack Error: ENOENT: no such file or directory, rename '/Users/Username/Sites/Sitename/node_modules/firebase-admin/node_modules/grpc/node_modules/abbrev' -> '/Users/Username/Sites/Sitename/node_modules/firebase-admin/node_modules/grpc/node_modules/.abbrev.DELETE'
8233 verbose cwd /Users/Username/Sites/Sitename
8234 verbose Darwin 16.7.0
8235 verbose argv "/Users/Username/.nvm/versions/node/v8.6.0/bin/node" "/Users/Username/.nvm/versions/node/v8.6.0/bin/npm" "update"
8236 verbose node v8.6.0
8237 verbose npm v5.5.1
8238 error path /Users/Username/Sites/Sitename/node_modules/firebase-admin/node_modules/grpc/node_modules/abbrev
8239 error code ENOENT
8240 error errno -2
8241 error syscall rename
8242 error enoent ENOENT: no such file or directory, rename '/Users/Username/Sites/Sitename/node_modules/firebase-admin/node_modules/grpc/node_modules/abbrev' -> '/Users/Username/Sites/Sitename/node_modules/firebase-admin/node_modules/grpc/node_modules/.abbrev.DELETE'
8243 error enoent This is related to npm not being able to find a file.
8244 verbose exit [ -2, true ]
Fix
For now, I’ve locked my firebase-admin at version 5.4.2, which prevents the error, but also prevents upgrading.
Hopefully you can fix this in the next version.
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:13 (3 by maintainers)
OS X 10.12.x
sudo rm -rf /usr/local/lib/node_modules
sudo npm install --unsafe-perm -g firebase-tools
firebase init
<setup a new firebase deployment with functions and hosting)firebase serve --only functions,hosting
The key for me was to completely delete node_modules directory from /usr/local/lib, and reinstall firebase-tools using the --unsafe-perm command line option. No other suggestion worked.
Hope this helps.
UPDATE 03/18/2016:
Doing a fresh clean install on OS X 10.14 I now realize this method is really not a good one, more importantly at the time of this writing not sure how well Node.js 8 was supported. Installing Node modules globally is not necessary and as it is not necessary, it’s also not a good idea / security risk.
I started using NVM (Node Version Manager) and it can simply be installed using the command:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
Using NVM installed node 6.x which I believe is still Google’s preferred Node version though they do seem to be adding 8 support. Once NVM is installed simply:
nvm install v6.11.5
From there getting firebase initialized and working was as simple as following the documentation. Th 10.12 box I was using was old, and must have had a lot of cache trash on it to be a good example here.
I faced the same issue. try to remove
node_modules
and install again. It worked for me.