Trouble installing a with NPM in a folder


I’m working on a project that uses Cloud Functions for Firebase.

Cloud Functions requires that I run npm install inside of the /functions folder.

Every time I try to npm install I get an error:

ERROR EACCES: permission denied, mkdir '/app'

I’ve tried setting TMPDIR=/tmp in .env, but it’s not resolving it.

The project is named pepper-nest

It’s easy to reproduce by opening the console and running cd functions && TMPDIR=/tmp npm install

Firebase deploy error

Hi @deltaepsilon,

we are using a different package manager, pnpm, with some custom tweaking, to make installs faster and take less space. On the other hand, if you want to run npm install on other directories, you need to pick one of these three options:

  1. write .npmrc file inside the functions/ folder, with this content:
    store = /app/.pnpm-store
  1. use npm-real install instead of npm install

  2. from the Console, run enable-npm, which switches your project to npm instead of pnpm.

UPDATE: I fixed the content of .npmrc


pnpm is fine, so I set the .npmrc file and ran pnpm install.

It took a few tries, because I kept running out of disk space… but after messing around a bit I was able to get everything to compile and install.



Glad it worked :slight_smile: I am working on making this side cases better handled, so you won’t need this manual tweaks anymore! I’ll let you know!