Coder Social home page Coder Social logo

firepit's People

Contributors

abeisgoat avatar jsayol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

firepit's Issues

SyntaxError: Unexpected end of JSON input

Hi, when I use the exe file and run it for the first time it gives out the following error below:

###############

~ Let's make sure your Firebase CLI is ready...
undefined:1

SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at ChildProcess.checkSpawn.on (C:\snapshot\firepit\welcome.js:82:27)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Socket.stream.socket.on (internal/child_process.js:380:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close [as _onclose] (net.js:595:12)

###########

Any advice how to fix this error?

Hide npm warning

npm keeps saying...

npm WARN lifecycle npm is using /Users/abehaskins/Development/firepit/dist/firepit-macos but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

Make it not.

Errors trying to use "firebase" and "npm" commands

D:\Downloads\Firepit>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.17134 N/A Build 17134

I just gave it a try but there seems to be something wrong. For the record, I don't have Node.js installed on my Windows machine although from what I understand it shouldn't be necessary, right?

Here's what I'm seeing:

Welcome to the Firebase Shell! You can type 'firebase' or 'npm' to run commands!

D:\Downloads\Firepit>npm
internal/modules/cjs/loader.js:594
    throw err;
    ^

Error: Cannot find module 'is:npm'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:592:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1280:46)
    at Function.Module._load (internal/modules/cjs/loader.js:518:25)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1309:12)
    at startup (internal/bootstrap/node.js:274:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:608:3)

D:\Downloads\Firepit>firebase
> help
ReferenceError: help is not defined
> ?
?
^

SyntaxError: Unexpected token ?

> exit
ReferenceError: exit is not defined
> quit
ReferenceError: quit is not defined
>
(To exit, press ^C again or type .exit)
>

D:\Downloads\Firepit>firebase --help
internal/modules/cjs/loader.js:594
    throw err;
    ^

Error: Cannot find module '--help'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:592:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1280:46)
    at Function.Module._load (internal/modules/cjs/loader.js:518:25)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1309:12)
    at startup (internal/bootstrap/node.js:274:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:608:3)

D:\Downloads\Firepit>firebase init
internal/modules/cjs/loader.js:594
    throw err;
    ^

Error: Cannot find module 'init'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:592:15)
    at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1280:46)
    at Function.Module._load (internal/modules/cjs/loader.js:518:25)
    at Function.Module.runMain (pkg/prelude/bootstrap.js:1309:12)
    at startup (internal/bootstrap/node.js:274:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:608:3)

I tried enabling debug logging with --pit:log-debug but it just logs an extra "Welcome to firepit!" line at the beginning

Include `mini-nvm`

I'm very interested in unpinning the Node.js runtime which is used to hoist firepit from the Node.js version used to run commands and lifecycle hooks. This is especially useful for emulating Firebase functions which should be ran on a specific node version.

To do this, we'd use the node npm package wrapped with a thin client (perhaps an even thinner client over npx) which would implement commands.

node --version # Throws error asking you to set node version with engine command
engine use 10 # Installs and sets default node version
node --version # 10.*
engine use 6 #  Installs and sets 6 alongside 10
node --version # 6.*
engine use 6 # Uses 6, doesn't need to install

This should be trivial to implement, the complexity will only come from inside Firepit where we must discover and prefer the cached node installation over the included one.

I'm also extremely open to naming ideas for the command. I'm pitching engine because it lines up with the engine field in package.json

Closes after help/intro output

Hi, after it downloaded npm packages it just closed. After opening again, it closes instantly. For a brief window, I can see probably output of help command or some introduction.

I tried deleting .cache firebase folder and running it with admin rights. Same result.

Firebase folder contains bin and cli folders.
Content of npmrc is prefix = C:\Users\denis.cache\firebase\cli

Using Ctrl+C closes .exe

I don't know if it is by design but using Ctrl+C close the whole .exe when the expected is to stop the script being executed. For example, when running firebase serve to test some simple web and then, lets says, I would like to stop the execution of the serve script, I can't do it using Ctrl+C.

Error: Failed parsing JSON config key prefix

Can't start firepit-win:

C:\Users\user\Downloads>firepit-win-0-0-7.exe
Please wait while the Firebase CLI downloads...
Error: Failed parsing JSON config key prefix: "C:\Users\user\.cache\firebase\cli"
    at parseField (C:\snapshot\firepit\node_modules\npm\lib\config\core.js:376:13)
    at C:\snapshot\firepit\node_modules\npm\lib\config\core.js:330:24
    at Array.forEach (<anonymous>)
    at Conf.add (C:\snapshot\firepit\node_modules\npm\lib\config\core.js:328:23)
    at ConfigChain.addString (C:\snapshot\firepit\node_modules\npm\node_modules\config-chain\index.js:244:8)
    at Conf.<anonymous> (C:\snapshot\firepit\node_modules\npm\lib\config\core.js:316:10)
    at C:\snapshot\firepit\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:86:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:442:3)
TypeError: Cannot read property 'get' of undefined
    at errorHandler (C:\snapshot\firepit\node_modules\npm\lib\utils\error-handler.js:205:18)
    at C:\snapshot\firepit\node_modules\npm\bin\npm-cli.js:76:20
    at cb (C:\snapshot\firepit\node_modules\npm\lib\npm.js:228:22)
    at C:\snapshot\firepit\node_modules\npm\lib\npm.js:266:24
    at C:\snapshot\firepit\node_modules\npm\lib\config\core.js:83:7
    at Array.forEach (<anonymous>)
    at Conf.<anonymous> (C:\snapshot\firepit\node_modules\npm\lib\config\core.js:82:13)
    at Conf.f (C:\snapshot\firepit\node_modules\npm\node_modules\once\once.js:25:25)
    at Object.onceWrapper (events.js:273:13)
    at Conf.emit (events.js:182:13)
C:\snapshot\firepit\node_modules\npm\lib\utils\error-handler.js:205
  if (npm.config.get('json')) {
                 ^

TypeError: Cannot read property 'get' of undefined
    at process.errorHandler (C:\snapshot\firepit\node_modules\npm\lib\utils\error-handler.js:205:18)
    at process.emit (events.js:182:13)
    at process._fatalException (internal/bootstrap/node.js:484:27)

Cannot run npm script inside Firepit

If I try running an npm script from inside Firepit I get the following error:

C:\Users\josep\Firepit\test\functions>npm run build
npm ERR! path C:\Users\josep\.cache\firebase\cli\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\josep\.cache\firebase\cli\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\josep\AppData\Roaming\npm-cache\_logs\2019-01-24T22_34_39_337Z-debug.log

Running it with the "normal" npm works as expected:

C:\Users\josep\Firepit\test\functions>npm run build

> functions@ build C:\Users\josep\Firepit\test\functions
> tsc

2019-01-24T22_34_39_337Z-debug.log

Bundle firebase-tools as a dependency

You mentioned you were thinking about installing firebase-tools during the first run if it's missing, and at first that seems seems like a good approach.

But I was thinking, why not just add it as a dependency to Firepit so that it's bundled in the distributed binary? As far as I can tell, the dependency tree of firebase-tools doesn't include any Node.js native modules so it shouldn't be an issue.

I did a quick test and bundling it adds around 40 MB to the current 58 MB, which is not negligible. But considering that Firepit will be mostly used by those that don't have the CLI installed (or even Node.js for that matter) I think it makes sense.

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.