Skip to content

Functions only deploy erroring, referencing parent application node_modules folder #749

Closed
@dylanjmcdonald

Description

@dylanjmcdonald

Version info

firebase: 3.18.4
node: 8.10.0
npm: 5.6.0

Platform Information

Windows

Steps to reproduce

firebase deploy --only functions

Expected behavior

Firebase cloud functions will deploy successfully.

Actual behavior

Receiving an error because the cloud functions build seems to be referencing the node_modules folder from the root level of the application. @types/d3 and @types/googlemaps are included in my applications package.json file and not my functions package.json file.

=== Deploying to 'PROJECT_NAME'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

> functions@ lint [PATH ON LOCAL MACHINE]\functions
> tslint --project tsconfig.json

Running command: npm --prefix "$RESOURCE_DIR" run build

> functions@ build [PATH ON LOCAL MACHINE]\functions
> tsc

../node_modules/@types/d3-axis/index.d.ts(50,36): error TS2304: Cannot find name 'SVGSVGElement'.
../node_modules/@types/d3-axis/index.d.ts(50,52): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(32,23): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(39,27): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(50,27): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(63,27): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(63,77): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(70,27): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(81,32): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(94,32): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(94,72): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(98,23): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(121,28): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(126,23): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(138,30): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(164,36): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(191,45): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-brush/index.d.ts(223,38): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-chord/index.d.ts(360,16): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-chord/index.d.ts(368,22): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-dispatch/index.d.ts(8,37): error TS2304: Cannot find name 'EventTarget'.
../node_modules/@types/d3-dispatch/index.d.ts(18,36): error TS2304: Cannot find name 'EventTarget'.
../node_modules/@types/d3-drag/index.d.ts(19,38): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-drag/index.d.ts(24,36): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/d3-drag/index.d.ts(24,50): error TS2304: Cannot find name 'SVGSVGElement'.
../node_modules/@types/d3-drag/index.d.ts(24,66): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-drag/index.d.ts(390,37): error TS2304: Cannot find name 'Window'.
../node_modules/@types/d3-drag/index.d.ts(402,36): error TS2304: Cannot find name 'Window'.
../node_modules/@types/d3-fetch/index.d.ts(18,42): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(18,64): error TS2304: Cannot find name 'Blob'.
../node_modules/@types/d3-fetch/index.d.ts(27,44): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(41,12): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(82,11): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(100,12): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(145,11): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(157,42): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(157,64): error TS2304: Cannot find name 'Document'.
../node_modules/@types/d3-fetch/index.d.ts(167,74): error TS2304: Cannot find name 'HTMLImageElement'.
../node_modules/@types/d3-fetch/index.d.ts(179,72): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(189,41): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(189,63): error TS2304: Cannot find name 'Document'.
../node_modules/@types/d3-fetch/index.d.ts(199,42): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(212,12): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(254,11): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(266,41): error TS2304: Cannot find name 'RequestInit'.
../node_modules/@types/d3-fetch/index.d.ts(266,63): error TS2304: Cannot find name 'XMLDocument'.
../node_modules/@types/d3-selection/index.d.ts(17,24): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(17,49): error TS2304: Cannot find name 'Document'.
../node_modules/@types/d3-selection/index.d.ts(17,60): error TS2304: Cannot find name 'Window'.
../node_modules/@types/d3-selection/index.d.ts(34,20): error TS2304: Cannot find name 'Document'.
../node_modules/@types/d3-selection/index.d.ts(36,27): error TS2304: Cannot find name 'Node'.
../node_modules/@types/d3-selection/index.d.ts(36,34): error TS2304: Cannot find name 'Node'.
../node_modules/@types/d3-selection/index.d.ts(37,28): error TS2304: Cannot find name 'Node'.
../node_modules/@types/d3-selection/index.d.ts(37,44): error TS2304: Cannot find name 'Node'.
../node_modules/@types/d3-selection/index.d.ts(37,51): error TS2304: Cannot find name 'Node'.
../node_modules/@types/d3-selection/index.d.ts(38,39): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(39,42): error TS2304: Cannot find name 'NodeListOf'.
../node_modules/@types/d3-selection/index.d.ts(39,53): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(45,32): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/d3-selection/index.d.ts(45,46): error TS2304: Cannot find name 'SVGSVGElement'.
../node_modules/@types/d3-selection/index.d.ts(45,62): error TS2304: Cannot find name 'SVGGElement'.
../node_modules/@types/d3-selection/index.d.ts(110,110): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/d3-selection/index.d.ts(142,113): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/d3-selection/index.d.ts(873,43): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/d3-selection/index.d.ts(977,61): error TS2304: Cannot find name 'TouchList'.
../node_modules/@types/d3-selection/index.d.ts(989,64): error TS2304: Cannot find name 'TouchList'.
../node_modules/@types/d3-selection/index.d.ts(1013,29): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1025,15): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1033,18): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1040,15): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1040,35): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1108,33): error TS2304: Cannot find name 'Window'.
../node_modules/@types/d3-selection/index.d.ts(1108,42): error TS2304: Cannot find name 'Document'.
../node_modules/@types/d3-selection/index.d.ts(1108,53): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1108,63): error TS2304: Cannot find name 'Window'.
../node_modules/@types/d3-selection/index.d.ts(1122,44): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1133,45): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1154,46): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1163,49): error TS2304: Cannot find name 'Element'.
../node_modules/@types/d3-selection/index.d.ts(1163,97): error TS2304: Cannot find name 'NodeListOf'.
../node_modules/@types/d3-shape/index.d.ts(304,16): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(312,22): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(757,16): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(765,22): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(935,16): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(943,22): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(1230,16): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(1238,22): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(1536,16): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(1544,22): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(1650,15): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(1686,15): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(2016,16): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(2024,22): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(2196,16): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(2204,22): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(2273,19): error TS2304: Cannot find name 'CanvasPathMethods'.
../node_modules/@types/d3-shape/index.d.ts(2358,16): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-shape/index.d.ts(2366,22): error TS2304: Cannot find name 'CanvasRenderingContext2D'.
../node_modules/@types/d3-transition/index.d.ts(572,65): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/d3-transition/index.d.ts(583,104): error TS2304: Cannot find name 'HTMLElement'.
../node_modules/@types/d3-zoom/index.d.ts(20,37): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(33,29): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(37,19): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(54,28): error TS2304: Cannot find name 'Node'.
../node_modules/@types/googlemaps/index.d.ts(788,30): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(799,36): error TS2304: Cannot find name 'Node'.
../node_modules/@types/googlemaps/index.d.ts(812,26): error TS2304: Cannot find name 'Node'.
../node_modules/@types/googlemaps/index.d.ts(1136,20): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1137,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1138,18): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1139,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1140,23): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1141,23): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1142,29): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1143,24): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1220,21): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1225,25): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1236,17): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1653,32): error TS2304: Cannot find name 'Node'.
../node_modules/@types/googlemaps/index.d.ts(1668,64): error TS2304: Cannot find name 'Document'.
../node_modules/@types/googlemaps/index.d.ts(1668,75): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1669,27): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1692,64): error TS2304: Cannot find name 'Document'.
../node_modules/@types/googlemaps/index.d.ts(1692,75): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1693,27): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1709,64): error TS2304: Cannot find name 'Document'.
../node_modules/@types/googlemaps/index.d.ts(1709,75): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1710,27): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1941,32): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1942,28): error TS2304: Cannot find name 'Node'.
../node_modules/@types/googlemaps/index.d.ts(2394,36): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(2398,29): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(2455,37): error TS2304: Cannot find name 'HTMLInputElement'.
../node_modules/@types/googlemaps/index.d.ts(2616,40): error TS2304: Cannot find name 'HTMLDivElement'.
../node_modules/@types/googlemaps/index.d.ts(2663,37): error TS2304: Cannot find name 'HTMLInputElement'.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ build: `tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     [PATH ON LOCAL MACHINE]\AppData\Roaming\npm-cache\_logs\2018-04-19T16_10_21_812Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code2```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions