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
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:
- write
.npmrc
file inside the functions/
folder, with this content:
store = /app/.pnpm-store
-
use npm-real install
instead of npm install
-
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.
THANK YOU SO MUCH!!!
Glad it worked I am working on making this side cases better handled, so you won’t need this manual tweaks anymore! I’ll let you know!
1 Like