question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm update firebase-admin fails with ENOENT: no such file or directory, rename

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
Shashanesscommented, Mar 18, 2019

OS X 10.12.x

  1. sudo rm -rf /usr/local/lib/node_modules
  2. Install Stable Node.js from https://nodejs.org/dist/v8.9.4/node-v8.9.4.pkg
  3. sudo npm install --unsafe-perm -g firebase-tools
  4. firebase init <setup a new firebase deployment with functions and hosting)
  5. 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.

5reactions
thakkaryash94commented, Oct 25, 2017

I faced the same issue. try to remove node_modules and install again. It worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NPM: ENOENT: no such file or directory, rename
Open whatever editor/terminal you're using to npm install with admin permission. Share.
Read more >
How to fix: npm ERR! enoent ENOENT: no such file or ...
The error message was npm ERR! enoent ENOENT: no such file or directory, rename 'D:\\WebApp\\node_modules\\lz-string' ...
Read more >
firebase-tools - npm
This command will create a firebase.json configuration file in your current directory. help, Display help information about the CLI or specific ...
Read more >
Firebase JavaScript SDK Release Notes - Google
Updated firebase -admin and firebase-functions dependencies to address protobufjs security issue. Version 9.9.0 - July 07, 2022. Added the missing CDN build and ......
Read more >
NPM install error - Material Design for Bootstrap
Delete node_modules folder and package-json.lock · Then run npm i · If problem still exists repeat point 1 and go to 4 point...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found