Firebase-tools: Firebase deploy functions for Node 8 fails

Created on 12 Oct 2018  路  2Comments  路  Source: firebase/firebase-tools

Firebase version: 5.0.1
OS: OSX Mojave

I am migrating my cloud functions from NodeJS 6 to 8. I added "engines": { "node": "8" } to my package.json per https://firebase.googleblog.com/2018/08/cloud-functions-for-firebase-config-node-8-timeout-memory-region.html

The issue is that the functions crash at deploy now. Here is the error output:

Build failed: USER ERROR:
`npm_install` had stderr output:
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/jsdom-b7c793b5/LICENSE.txt'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/jsdom-b7c793b5/README.md'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@google-cloud/storage-66ff4fa1/src/channel.js'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@google-cloud/storage-66ff4fa1/src/file.js'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/puppeteer-ae15154d/lib/Page.js'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/googleapis-329f5f2f/build/src/apis/adexchangebuyer/v1.4.js.map'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@google-cloud/firestore-8f58c2ea/build/protos/firestore_proto_api.js'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/mysql-38765a6f/lib/protocol/constants/field_flags.js'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/mysql-38765a6f/lib/protocol/constants/server_status.js'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/mysql-38765a6f/lib/protocol/constants/ssl_profiles.js'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/@firebase/firestore-b673fc55/dist/index.esm.js'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/readline-0ab89ae3/test/fixtures/file-in-win1251.txt'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/readline-0ab89ae3/test/fixtures/nmbr.txt'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/protobufjs-e78f053b/docs/fonts/OpenSans-Regular-webfont.woff'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/protobufjs-26218390/docs/index.html'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/protobufjs-26218390/docs/ProtoBuf.Builder.html'
npm WARN tar ENOENT: no such file or directory, open '/workspace/node_modules/.staging/protobufjs-26218390/docs/ProtoBuf.Builder.Message.html'
npm WARN tar ENOENT: no such file or directory, lstat '/workspace/node_modules/.staging/googleapis-329f5f2f/build/src/apis'
npm WARN tar ENOENT: no such file or directory, lstat '/workspace/node_modules/.staging/googleapis-329f5f2f/build'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@google-cloud/firestore/node_modules/grpc):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: Cannot cd into '/workspace/node_modules/.staging/grpc-a3cfde86'

npm ERR! code E404
npm ERR! 404 Not Found: grpc@https://registry.npmjs.org/grpc/-/grpc-1.12.0.tgz

npm ERR! A complete log of this run can be found in:
npm ERR!     /builder/home/.npm/_logs/2018-10-12T17_08_49_088Z-debug.log

error: `npm_install` returned code: 1

I've gone ahead and updated firebase-functions, firebase-tools, and firebase-admin to the latest versions both at the root of my project and in the functions folder. What am I missing?

Most helpful comment

Found a solution--needed to nuke the package-lock.json file that was in the functions folder.

All 2 comments

Found a solution--needed to nuke the package-lock.json file that was in the functions folder.

Found a solution--needed to nuke the package-lock.json file that was in the functions folder.

I have tried the same but so far no luck.
Just out of curiosity, did you also add the package-lock.json to your .gcloudignore file?

Was this page helpful?
0 / 5 - 0 ratings