0
votes

i have some deployment issues with deployment of my firebase functions, I can see that is a problem with npm, i have tried with 5 different versions of npm while running as admin but it still doesn't work, anyone got an idea og what is wrong? i have added the cmd print and the npm log

enter image description here

0 info it worked if it ends with ok

1 verbose cli [ 'C:\Program Files\nodejs\node.exe',

1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',

1 verbose cli '--prefix',

1 verbose cli '$RESOURCE_DIR',

1 verbose cli 'run',

1 verbose cli 'lint' ]

2 info using [email protected]

3 info using [email protected]

4 verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\nstavsholm\Desktop\NIKLAS\Praktik\bitcoin-info-action- master\$RESOURCE_DIR\package.json'

5 verbose cwd C:\Users\nstavsholm\Desktop\NIKLAS\Praktik\bitcoin-info-action- master

6 verbose Windows_NT 6.3.9600

7 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "--prefix" "$RESOURCE_DIR" "run" "lint"

8 verbose node v8.9.4

9 verbose npm v5.6.0

10 error path C:\Users\nstavsholm\Desktop\NIKLAS\Praktik\bitcoin-info-action-master\$RESOURCE_DIR\package.json

11 error code ENOENT

12 error errno -4058

13 error syscall open

14 error enoent ENOENT: no such file or directory, open 'C:\Users\nstavsholm\Desktop\NIKLAS\Praktik\bitcoin-info-action-master\$RESOURCE_DIR\package.json'

15 error enoent This is related to npm not being able to find a file.

16 verbose exit [ -4058, true ]

2
make sure you are runing firebase deploy command from the same directory where you have your serving file and package.json, and all of your npm scripts are executaing without errorRidham Tarpara
my npm runs fine with no errors and i am sure that i have deployed in the right directory, i have tried in different levels of the directory and it still does not work :/Niklas Brandt Stavsholm

2 Answers

0
votes

1. Try to replace $RESOURCE_DIR with %RESOURCE_DIR% in your firebase.json file.

or

2. (This one should solve the issue without workaround)

npm install -g git://github.com/firebase/firebase-tools#master

please try this installation again in ur project folder it should solve the issue.

0
votes

Ridham Tarpara's comment under the question saved me.

I had kept trying to npm install a package to the project at the folder level. But the package.json files are in the functions folder on firebase functions projects...
...so you have to cd into the functions folder and then install.

This solved my errors!