Giter VIP home page Giter VIP logo

Comments (13)

chadamodio avatar chadamodio commented on August 10, 2024 9

@oknowwhat @codediodeio

I believe I solved this and by the way I was running into this error in Windows (not sure if that matters or not)

Reference: yarnpkg/yarn#1657

Specifically:

drop "./node_modules/.bin/"

In the package.json file I changed the build to this:
"build": "tslint -p tslint.json && tsc",

Then I had another issue with types/googlemaps which was solved here:
https://stackoverflow.com/questions/47556819/firebase-admin-package-typescript-error-in-cloud-functions-firestore-types-go

By add this to my tsconfig.json file:
"files": [ "node_modules/typescript/lib/lib.es6.d.ts" ]

from angular-firebase-stripe.

jackxscript avatar jackxscript commented on August 10, 2024 6

Firebase + Angular: The only framework where you spend more time trying to deploy then you do creating the actual program LMAO

I've literally been dealing with this issue for days. I'm at a point to where the only solutions I keep seeing are the same ones I've tried. I guess it's time to explore page 20 of the Google index.....

from angular-firebase-stripe.

oknowwhat avatar oknowwhat commented on August 10, 2024 1

it's fine. admin SDK into the credentials.json file solved the issues.

from angular-firebase-stripe.

gderick-1 avatar gderick-1 commented on August 10, 2024 1

@oknowwhat @codediodeio

I believe I solved this and by the way I was running into this error in Windows (not sure if that matters or not)

Reference: yarnpkg/yarn#1657

Specifically:

drop "./node_modules/.bin/"

In the package.json file I changed the build to this:
"build": "tslint -p tslint.json && tsc",

Thanks, this work for me

from angular-firebase-stripe.

oknowwhat avatar oknowwhat commented on August 10, 2024

Debug Log:

  • 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 'functions',
    1 verbose cli 'run',
    1 verbose cli 'build' ]
    2 info using [email protected]
    3 info using [email protected]
    4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
    5 info lifecycle functions@~prebuild: functions@
    6 info lifecycle functions@~build: functions@
    7 verbose lifecycle functions@~build: unsafe-perm in lifecycle true
    8 verbose lifecycle functions@~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:_Companies-I-Own\aa\stripeDemo\functions\node_modules.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files\nodejs;C:\Ruby25-x64\bin;C:\Users\Logan\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Heroku\bin;C:\Users\Logan\AppData\Roaming\npm
    9 verbose lifecycle functions@~build: CWD: E:_Companies-I-Own\aa\stripeDemo\functions
    10 silly lifecycle functions@~build: Args: [ '/d /s /c',
    10 silly lifecycle 'tslint -p tslint.json && ./node_modules/.bin/tsc' ]
    11 silly lifecycle functions@~build: Returned: code: 1 signal: null
    12 info lifecycle functions@~build: Failed to exec build script
    13 verbose stack Error: functions@ build: tslint -p tslint.json && ./node_modules/.bin/tsc
    13 verbose stack Exit status 1
    13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
    13 verbose stack at emitTwo (events.js:126:13)
    13 verbose stack at EventEmitter.emit (events.js:214:7)
    13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
    13 verbose stack at emitTwo (events.js:126:13)
    13 verbose stack at ChildProcess.emit (events.js:214:7)
    13 verbose stack at maybeClose (internal/child_process.js:925:16)
    13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
    14 verbose pkgid functions@
    15 verbose cwd E:_Companies-I-Own\aa\stripeDemo
    16 verbose Windows_NT 10.0.16299
    17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "--prefix" "functions" "run" "build"
    18 verbose node v8.11.1
    19 verbose npm v5.6.0
    20 error code ELIFECYCLE
    21 error errno 1
    22 error functions@ build: tslint -p tslint.json && ./node_modules/.bin/tsc
    22 error Exit status 1
    23 error Failed at the functions@ build script.
    23 error This is probably not a problem with npm. There is likely additional logging output above.
    24 verbose exit [ 1, true ]

from angular-firebase-stripe.

oknowwhat avatar oknowwhat commented on August 10, 2024

it appears that the package.json file is throwing up the errors due to the "build" function. when changed to "build": firebase serve --only functions" it runs but throws up an error claiming the latest SDK of firebase functions isn't present.

Warning: You're using Node.js v8.11.1 but Google Cloud Functions only supports v6.11.5.
! functions: Failed to load functions source code. Ensure that you have the latest SDK by running npm i --save firebase-functions inside the functions directory.
! functions: Error from emulator. Error parsing triggers: Cannot find module 'E:_Companies-I-Own\aa\stripeDemo\functions'

from angular-firebase-stripe.

codediodeio avatar codediodeio commented on August 10, 2024

I just pushed updates for Cloud Functions v1.0.

Note: I moved the Stripe API keys in credentials.json due to a bug between FCF and firebase-tools

Also, try installing node v6.11.5 (I recommend NVM) then run npm rebuild to update your packages. This is more reliable when working with functions locally.

from angular-firebase-stripe.

oknowwhat avatar oknowwhat commented on August 10, 2024

M:\bb\stripeDemo\functions>firebase deploy --only functions

=== Deploying to 'angularfirebasedemoapp'...

i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "--prefix" "M:\bb\stripeDemo\functions" "run" "lint"
npm ERR! node v6.11.5
npm ERR! npm v3.10.10

npm ERR! missing script: lint
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! M:\bb\stripeDemo\npm-debug.log

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

from angular-firebase-stripe.

oknowwhat avatar oknowwhat commented on August 10, 2024

still does not deploy

from angular-firebase-stripe.

oknowwhat avatar oknowwhat commented on August 10, 2024

I removed
"npm --prefix \"%RESOURCE_DIR%\" run lint",
just to see if it deployed. It did not deploy still.

M:\bb\stripeDemo\functions>firebase deploy --only functions

=== Deploying to 'angularfirebasedemoapp'...

i deploying functions
Running command: npm --prefix "%RESOURCE_DIR%" run build

functions@ build M:\bb\stripeDemo\functions
tslint -p tslint.json && ./node_modules/.bin/tsc

typeof-compare is deprecated. Starting from TypeScript 2.2 the compiler includes this check which makes this rule redundant.
'.' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "--prefix" "M:\bb\stripeDemo\functions" "run" "build"
npm ERR! node v6.11.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! functions@ build: tslint -p tslint.json && ./node_modules/.bin/tsc
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ build script 'tslint -p tslint.json && ./node_modules/.bin/tsc'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the functions package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tslint -p tslint.json && ./node_modules/.bin/tsc
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs functions
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls functions
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! M:\bb\stripeDemo\npm-debug.log

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

Having trouble? Try firebase deploy --help

from angular-firebase-stripe.

oknowwhat avatar oknowwhat commented on August 10, 2024

error when deploying on Mac osX:
=== Deploying to 'angularfirebasedemoapp'...

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

functions@ build /Users/loganwalsh/Documents/untitled folder/stripeDemo/functions
tslint -p tslint.json && ./node_modules/.bin/tsc

✔ functions: Finished running predeploy script.
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...

Error: Error occurred while parsing your function triggers.

SyntaxError: /Users/loganwalsh/Documents/untitled folder/stripeDemo/functions/credentials.json: Unexpected end of JSON input
at JSON.parse ()
at Object.Module._extensions..json (module.js:671:27)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/Users/loganwalsh/Documents/untitled folder/stripeDemo/functions/lib/app/config.js:21:24)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
logans-Mac-mini:functions loganwalsh$

from angular-firebase-stripe.

chadamodio avatar chadamodio commented on August 10, 2024

@codediodeio - I am getting the same error:

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ build: tslint -p tslint.json && ./node_modules/.bin/tsc
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ build script.

LOG
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\ChadA\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli '--prefix',
1 verbose cli 'C:\Users\ChadA\Documents\GitHub\projectStripe\functions',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle functions@~prebuild: functions@
6 info lifecycle functions@~build: functions@
7 verbose lifecycle functions@~build: unsafe-perm in lifecycle true
8 verbose lifecycle functions@~build: PATH: ...removed to save space
9 verbose lifecycle functions@~build: CWD: C:\Users\ChadA\Documents\GitHub\projectStripe\functions
10 silly lifecycle functions@~build: Args: [ '/d /s /c',
10 silly lifecycle 'tslint -p tslint.json && ./node_modules/.bin/tsc' ]
11 silly lifecycle functions@~build: Returned: code: 1 signal: null
12 info lifecycle functions@~build: Failed to exec build script
13 verbose stack Error: functions@ build: tslint -p tslint.json && ./node_modules/.bin/tsc
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Users\ChadA\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:280:16)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at EventEmitter.emit (events.js:191:7)
13 verbose stack at ChildProcess. (C:\Users\ChadA\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at ChildProcess.emit (events.js:191:7)
13 verbose stack at maybeClose (internal/child_process.js:886:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid functions@
15 verbose cwd C:\Users\ChadA\Documents\GitHub\projectStripe
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\ChadA\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "--prefix" "C:\Users\ChadA\Documents\GitHub\projectStripe\functions" "run" "build"
18 verbose node v6.10.2
19 verbose npm v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error functions@ build: tslint -p tslint.json && ./node_modules/.bin/tsc
22 error Exit status 1
23 error Failed at the functions@ build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

from angular-firebase-stripe.

oknowwhat avatar oknowwhat commented on August 10, 2024

@chadamodio dropping the "./node_modules/.bin/" worked but then I got a new error after configuring the credentials.json

Did you also get the following error?

Error: Failed to parse private key: Error: Invalid PEM formatted message.

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

functions@ build M:\aa\stripeDemo\functions
tslint -p tslint.json && tsc

typeof-compare is deprecated. Starting from TypeScript 2.2 the compiler includes this check which makes this rule redundant.

  • functions: Finished running predeploy script.
    i functions: ensuring necessary APIs are enabled...
  • functions: all necessary APIs are enabled
    i functions: preparing functions directory for uploading...

Error: Error occurred while parsing your function triggers.

Error: Failed to parse private key: Error: Invalid PEM formatted message.
at FirebaseAppError.Error (native)
at FirebaseAppError.FirebaseError [as constructor] (M:\aa\stripeDemo\functions\node_modules\firebase-admin\lib\utils\error.js:39:28)
at FirebaseAppError.PrefixedFirebaseError [as constructor] (M:\aa\stripeDemo\functions\node_modules\firebase-admin\lib\utils\error.js:85:28)
at new FirebaseAppError (M:\aa\stripeDemo\functions\node_modules\firebase-admin\lib\utils\error.js:119:28)
at new Certificate (M:\aa\stripeDemo\functions\node_modules\firebase-admin\lib\auth\credential.js:129:19)
at new CertCredential (M:\aa\stripeDemo\functions\node_modules\firebase-admin\lib\auth\credential.js:192:64)
at Object.cert (M:\aa\stripeDemo\functions\node_modules\firebase-admin\lib\firebase-namespace.js:224:58)
at Object. (M:\aa\stripeDemo\functions\lib\app\config.js:23:34)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)

Having trouble? Try firebase deploy --help

from angular-firebase-stripe.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.