Skip to content
This repository has been archived by the owner on May 15, 2019. It is now read-only.

EACCES: permission denied when attempting to launch shell #193

Closed
btrautmann opened this issue Feb 28, 2018 · 2 comments
Closed

EACCES: permission denied when attempting to launch shell #193

btrautmann opened this issue Feb 28, 2018 · 2 comments

Comments

@btrautmann
Copy link

btrautmann commented Feb 28, 2018

My goal is to be able to locally test my firestore functions which are all written in an index.js file. For context, I had permissions errors when first attempting to run the shell, and so I wiped node/npm from my system, installed nvm and then installed node/npm via that so the permission errors are now gone, aside from this one.

Environment details

  • OS: MacOS 10.13.3
  • Node.js version: v6.11.5 installed via nvm
  • npm version: 3.10.10
  • @google-cloud/functions-emulator version: functions-emulator@1.0.0-beta.3

Steps to reproduce

  1. Install nvm
  2. Install node via nvm
  3. nvm use v6.11.5 to ensure compatibility
  4. Follow steps here
    Namely:
    • npm install --save firebase-functions@latest
    • npm install -g firebase-tools
    • firebase experimental:functions:shell
  5. Receive the error in title:
i  functions: Preparing to emulate functions.
Error: EACCES: permission denied, open '/Users/brandontrautmann/.config/configstore/@google-cloud/functions-emulator/.functions.json'
You don't have access to this file.

    at Error (native)
    at Object.fs.openSync (fs.js:642:18)
    at Object.fs.readFileSync (fs.js:510:33)
    at Configstore.get all [as all] (/Users/brandontrautmann/.nvm/versions/node/v6.11.5/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator/node_modules/configstore/index.js:29:25)
    at new Configstore (/Users/brandontrautmann/.nvm/versions/node/v6.11.5/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator/node_modules/configstore/index.js:25:46)
    at new ConfigAdapter (/Users/brandontrautmann/.nvm/versions/node/v6.11.5/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator/src/model/functions.js:43:23)
    at new Functions (/Users/brandontrautmann/.nvm/versions/node/v6.11.5/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator/src/model/functions.js:136:22)
    at Object.exports.functions (/Users/brandontrautmann/.nvm/versions/node/v6.11.5/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator/src/model/index.js:22:34)
    at new Emulator (/Users/brandontrautmann/.nvm/versions/node/v6.11.5/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator/src/emulator/emulator.js:27:29)
    at Object.main (/Users/brandontrautmann/.nvm/versions/node/v6.11.5/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator/src/emulator/main.js:120:20)
⚠  functions: Error from emulator. Error: Emulator crashed! Check the log file...
No functions emulated.

Troubleshooting

  1. If run firebase experimental:functions:shell with sudo, this error is thrown:
i  functions: Preparing to emulate functions.
⚠  functions: Failed to emulate Error
No functions emulated.
  1. If I try to follow the emulator docs Troubleshooting and run the following:
  • npm uninstall -g @google-cloud/functions-emulator
  • npm uninstall -g firebase-tools
  • npm cache clean
  • node -v (verify this outputs v6.11.1 or newer)
  • npm install -g firebase-tools (this will re-install the Emulator)

I get the same error. If I try to install the emulator directly via npm install -g @google-cloud/functions-emulator I receive:

ERROR: Error: Emulator crashed! Check the log file...
    at ChildProcess.child.on (/Users/brandontrautmann/.nvm/versions/node/v6.11.5/lib/node_modules/@google-cloud/functions-emulator/src/cli/controller.js:646:24)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)

Any help would be greatly appreciated, thank you.

@santhoshdc1590
Copy link

@btrautmann I had the same issued, I even started the an issues here.
Turned out I had not installed the nvm and Node.js properly.
Here is the link

Hope this solves your problem

@btrautmann
Copy link
Author

btrautmann commented Mar 25, 2018

The issue was that even after fixing npm and Node installations, firebase folders I had created with the bad installation were still owned by root. I needed to chown the directories to fix the issue and now do not have any other problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants