Git Product home page Git Product logo

nodecg's Introduction

NodeCG

NodeCG

Discord Build Status Coverage Status Docker Build Status Twitter

NodeCG is a broadcast graphics framework and application. It enables you to write complex, dynamic broadcast graphics using the web platform. NodeCG has no graphics or drawing primitives of its own. Instead, NodeCG provides a structure for your code and an API to facilitate moving data between the dashboard, the server, and your graphics. It makes few assumptions about how to best code a graphic, and gives you freedom to use whatever libraries, frameworks, tools, and methodologies you want. As such, NodeCG graphics can be rendered in any environment that can render HTML, including:

Don't see your preferred streaming software on this list? NodeCG graphics require a modern browser engine. If your streaming software's implementation of browser source uses a recent-ish browser engine, chances are that NodeCG graphics will work in it. You can check what version your streaming software uses for its browser sources by opening whatversion.net/chrome as a browser source.

Have questions about NodeCG, or just want to say 'hi'? Join our Discord server!

Documentation & API Reference

Full docs and API reference are available at https://nodecg.dev

Goals

The NodeCG project exists to accomplish the following goals:

  • Make broadcast graphics (also known as "character generation" or "CG") more accessible.
  • Remain as close to the web platform as possible.
  • Support broadcasts of any size and ambition.

Let's unpack what these statements mean:

> Make broadcast graphics (also known as "character generation" or "CG") more accessible

Historically, broadcast graphics have been expensive. They either required expensive hardware, expensive software, or both. NodeCG was originally created to provide real-time broadcast graphics for Tip of the Hats, which is an all-volunteer charity fundraiser that had a budget of $0 for its first several years.

Now, it is possible to create an ambitious broadcast using entirely free software and consumer hardware. The NodeCG project embraces this democratization of broadcast technology.

> Remain as close to the web platform as possible

NodeCG graphics are just webpages. There is absolutely nothing special or unique about them. This is their greatest strength.

By building on the web platform, and not building too many abstractions on top of it, people developing broadcast graphics with NodeCG have access to the raw potential of the web. New APIs and capabilities are continually being added to the web platform, and NodeCG developers should have access to the entirety of what the web can offer.

> Support broadcasts of any size and ambition

NodeCG's roots are in small broadcasts with no budget. More recently, NodeCG has begun seeing use in increasingly elaborate productions. We believe that one set of tools can and should be able to scale up from the smallest show all the way to the biggest fathomable show. Whether you're using OBS for everything, or a hardware switcher with a traditional key/fill workflow, NodeCG can be a part of any broadcast graphics system.

Maintainers

Designers

Acknowledgements

nodecg's People

Contributors

atribecalledkwest avatar bitowl avatar carlosfdez avatar chr12t0pher avatar dan-shields avatar erynnb avatar ewanlyon avatar extremtechniker avatar github-actions[bot] avatar greenkeeper[bot] avatar greenkeeperio-bot avatar haganbmj avatar hoishin avatar madmatt avatar mattmcnam avatar nols1000 avatar richardlitt avatar seldszar avatar sikarii avatar simonfischer04 avatar sirtyler avatar thesupremecommander avatar tprovick avatar trezc0 avatar vibhavp avatar vodbox avatar wataru343 avatar whymog avatar zoton2 avatar zusorio 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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodecg's Issues

socket.io: "connection refused" when running with defaults on a hosted setup

After installing nodecg 0.6.1 using the nodecg-cli (from npm) and browsing to the dashboard, socket.io returns connection refused while the nodecg instance is being hosted on another computer:

GET http://localhost:9090/socket.io/?EIO=3&transport=polling&t=1442763099372-60 net::ERR_CONNECTION_REFUSED
Request.create @ socket.io.js:2919
Request @ socket.io.js:2842
XHR.request @ socket.io.js:2773
XHR.doPoll @ socket.io.js:2803
Polling.poll @ socket.io.js:3192
Polling.doOpen @ socket.io.js:3136
Transport.open @ socket.io.js:2313
Socket.open @ socket.io.js:1743
Socket @ socket.io.js:1625
Socket @ socket.io.js:1560
Manager.open.Manager.connect @ socket.io.js:299
(anonymous function) @ socket.io.js:564

This took me a while to figure even though localhost was staring at me in the eye. As a suggestion, shouldn't socket.io use the URL for hints where the nodecg is being hosted if defaults are being used?

Provide Javascript API for bundles

Packages shouldn't have to worry about including socket.io, and shouldn't have to interact with the socket directly.

Instead, an object should be injected which would allow functions similar to these:
nodecg.sendMessage(String messageName, Object data);
nodecg.listenFor(String messageName, Function handler);
nodecg.host, .port

An in-range update of @nodecg/bundle-manager is breaking the build 🚨

Version 0.5.2 of @nodecg/bundle-manager just got published.

Branch Build failing 🚨
Dependency @nodecg/bundle-manager
Current Version 0.5.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As @nodecg/bundle-manager is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 4 commits .

  • 90c163e v0.5.2
  • f2d62ab feat: add support for whitelisted loading of bundles via "enabled"
  • 35b2f71 Update README.md
  • 37fcb88 chore(package): update dependencies

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Support local authentication

Remove dependency on Twitch and Steam for providing authentication.

This will simply be adding local auth to the existing code rather than a re-write, which is still open (#139) but not immediately needed IMO

Margin added on <dom-if> elements inside dialogs

As the title says, margin is added on <dom-if> elements inside dashboard dialog boxes, but outside their iframes.

I'd love to take a look at it, if you're willing to point me at the problem. I've looked around but couldn't find much.

Routing as part of packages?

Are there any plans to be able to include routes in packages? As of right now, it seems that in order to add routes, they simply have to be added to server.js. Ideally, it would be nice to pull in routes from a js file such ie. package/routes.js.

Here is a Stack Overflow question which includes ideas on how this can be implemented.

This may or may not be out of the scope of the project, but I have a few small potential packages that I would use this for: Now Playing Overlay and a node implementation of Show Pressed Keys which could give you ideas.

Unlisten Replicant.on('change', cb)

Currently, as far as I know, there is no way to remove lister for Replicant.

For example, if you have a component with Replicant event listener set up when mounted, every time the component mounts it adds 'change' listener. If you could "unlisten" the listener when unmounting, this problem would not happen.

export class Twitter extends React.Component {
	cb = (newVal: Tweets) => {
		console.log(newVal[0].text);
	};
	listener: EventListener | null = null

	componentDidMount() {
		this.listener = tweetsRep.on('change', this.cb)
	}

	render() {
		return (
			<Container>
				<Label>ツイート表示管理</Label>
				<Empty>表示するツイートがありません</Empty>
			</Container>
		);
	}

	componentWillUnmount() {
		// Node EventEmitter way
		tweetsRep.removeListener('change', this.cb)
		tweetsRep.removeAllListener('change')

		// Also from Node v10
		tweetsRep.off('change', this.cb)
	}
}

Assets (media files) - Unexpected error sending file

In very rare circumstances I'm getting a "Headers already sent" error when trying to serve assets to my graphics in quick succession.

We play different sounds depending on the donation amount, and it seems to be when trying to swap the audio element over to a different source that this happens. The source is fetched from the assets:sounds replicant using the url property.

For reference I do believe the error is coming from here:

res.sendFile(fullPath, err => {

Logging

NodeCG should have logging to see who is signing in (when enabled), from what IP address, and what actions they perform on the dashboard.

Possible replicant regression 0.8.5

Heya

This code block stopped working as it doesn't see a change event on page load in 0.8.5. It works in 0.8.4.

Is this because 9e39d45 has broken something or does this code exploit a bug that should never have worked to begin with?

// Checks if the access token has been set yet or not on page load.
    // If not, gets one, if it has already got one, changes the buttons.
    var accessTokenReplicant = nodecg.Replicant('twitchAccessToken', {persistent: false});
    accessTokenReplicant.on('change', function(newValue, oldValue) {
        if (!newValue) {
            var parameter = getParameterByName('code');
            if(parameter != null && parameter != '') {
                nodecg.sendMessage('twitchLoginForwardCode', parameter);
                console.log("code is " + parameter);
            }

            streamControl_login(true);
        }

        else {streamControl_loginSuccessful();}
});

(line 149 onwards)

Login options

Currently, NodeCG only supports Steam OpenID as a method of authentication. This should be extended to support more OpenID providers, as well as username/password combos unique to each NCG installation, with accompanying admin UI.

Replicant Change Event Not Firing

Hey All. I am having a problem with using replicants. In the AGDQ 2016 layout, I liked the use of them to A) keep info global, B) use in place of message events (which can get ridiculous). The problem I have been having is that yes I am changing the replicant value properly as to the tutorials, in practice it is not working correctly.

For Starters, here is the Dashboard HTML and JS

`

<script src="components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="components/polymer/polymer.html">
<link rel="import" href="components/paper-input/paper-input.html">
<link rel="import" href="components/paper-input/paper-textarea.html">
<link rel="import" href="components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="components/paper-menu/paper-menu.html">
<link rel="import" href="components/paper-item/paper-item.html">
<link rel="import" href="components/paper-button/paper-button.html">
<link rel="import" href="components/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="stylesheet" href="css/main.css">
Pull Data
        <paper-button raised class="blue" id="update">Update</paper-button>
        <paper-button raised class="green" id="show">Show</paper-button>
        <paper-button raised class="red" id="hide">Hide</paper-button>

        <div class="layout horizontal">
        </div>
    </div>
</div>
<script src="js/overwatch-scoreboard.js" defer></script>
` `(function () { 'use strict';
// get the team scores
var team1score = document.getElementById('team-1-score');
var team2score = document.getElementById('team-2-score');

// Round Information
var team1name = document.getElementById('team1name');
var team2name = document.getElementById('team2name');

var roundinfo = document.getElementById('round');
// buttons
var pulldata = document.getElementById('trak-pull');
var show = document.getElementById('show');
var hide = document.getElementById('hide');
var update = document.getElementById('update').addEventListener('click', updateGraphic, false);

// UPDATE SCORES ON GRAPHIC COMMAND
var scores = nodecg.Replicant('scores');
var showing = nodecg.Replicant('scoreboardShowing');

function updateGraphic() {
    scores.value = [
        team1score.value,
        team2score.value,
        roundinfo.value

    ];
    console.log("Update Graphic Event Fired");
}
show.addEventListener('click', function() {
    showing.value = true;
});
showing.on('change', function (newVal, oldVal) {
    if (newVal) {

    }
})

})();`

Here is the graphic HTML and JS.

`

<title>Title</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js"></script>
<link rel="stylesheet" href="css/Scoreboard.css">
OW FREE AGENT INVITATIONAL
TEAM ONE
TEAM TWO
<script src="js/trak-e-scoreboard.js"></script> `

`(function () {

'use strict';

// Lets define our elements

var EVENT_NAME = document.getElementById('EVENT_TITLE');
var ROUND = document.getElementById('ROUND');
var T1NAME = document.getElementById('TEAM_ONE_NAME');
var T2NAME = document.getElementById('TEAM_TWO_NAME');
var T1SCORE = document.getElementById('T1_SCORE');
var T2SCORE = document.getElementById('T2_SCORE');

// Define the divs we will be animating.

var center = document.getElementById('center');
var team1 = document.getElementById('team1');
var team2 = document.getElementById('team2');

var tl = new TimelineLite({autoRemoveChildren: true});

// define our showing and hiding triggers
var showing = nodecg.Replicant('scoreboardShowing');
var scores = nodecg.Replicant('scores');

scores.on('change', function (newVal,oldVal) {
    var values = newVal.value;
    try {
        T1SCORE.value = values[0];
        T2SCORE.value = values[1];
        ROUND.value = values[2];
    }
    catch (exception) {
        console.log(exception);
    }
})
showing.on('change', function (newVal,oldVal) {
    if (newVal) {
        tl.call(function() {
            // set all the information to display
            var values = scores.value;

            T1SCORE.value = values[0];
            T2SCORE.value = values[1];
            ROUND.value = values[2];

        }, null, null, '+=0.1');

    }
});

})();`

What is exactly going on here other than my lack of coding style?

Uploading or modifying assets crashes NodeCG server

When trying to upload or modify assets (either via the web panel or live-renaming the local file), the NodeCG server crashes due to an unhandled exception:

UNCAUGHT EXCEPTION! NodeCG will now exit.
TypeError: replicantsByNamespace[uploadedFile.namespace][uploadedFile.category].value.push is not a function
    at sha1File ([nodecg-root]/lib/assets/index.js:118:79)
    at ReadStream.<anonymous> ([nodecg-root]/node_modules/sha1-file/index.js:21:14)
    at ReadStream.emit (events.js:187:15)
    at ReadStream.EventEmitter.emit (domain.js:441:20)
    at endReadableNT (_stream_readable.js:1098:12)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)

Replace CDN resources with bower dependencies

Where possible, replace CDN links with local copies, installed by bower.
Current CDN resources are:

  • Bootstrap
  • Font Awesome
  • html5shiv
  • respond.js
  • jQuery
  • Steam sign in image, may be replaced?

Provide an easier way to disable bundles

When developing a bundle, it would be nice to have a way to easily enable/disable other bundles.

Current workarounds:

  • Move bundle to a folder adjacent to bundles
  • Rename nodecg.json to something else ie. nodecg.json.disabled
  • Add Enabled property in nodecg.json that is true by default but can be flipped to false

Ideas:

  • Build a command into the nodecg-cli to do one of the above workarounds programmatically

Open to other ideas/solutions

Remove `bin` in package.json

Currently nodecg defines "bin": "index.js". If you install NodeCG as npm dependency, it will create nodecg bin which will conflict with nodecg-cli bin.

I'm not sure we can safely remove this line, but it would be nice to not have the conflict.

v0.9.11: ERR_EMPTY_RESPONSE when loading graphics

I've just done a fresh "install" of NodeCG and made sure NodeJS and npm are all as up to date as they can be.

I've created a very basic bundle with nothing in it other than a single graphic HTML file which does nothing other than create a blank div currently.

My dashboard loads fine but everytime I try and load any graphic at all (even ones that dont exist), Chrome will sit doing nothing for ages and eventually return saying ERR_EMPTY_RESPONSE.

This seems to happen with existing bundles too.

Convert nodecg to act as a command line tool

A new user shouldn't have to grab the repository to use nodecg.

The current goal workflow is:

  • npm install nodecg
  • nodecg init my-overlay
  • cd my-overlay
  • nodecg start

The folder my-overlay should only contain a config file, and a packages folder.

Migrate from bower to yarn or npm

The bower team will display a warning if bower is installed. The warning refers to a blog post in which they recommend switching from bower to yarn and webpack.

npm WARN deprecated [email protected]: ...psst! Your project can stop working at any moment 
because its dependencies can change. Prevent this by migrating to Yarn: 
https://bower.io/blog/2017/how-to-migrate-away-from-bower/

I think it would be good to migrate now for two reasons:

  1. if the bower team decides to stop supporting bower (which looks like it won't happen now, but it could happen later), the project would not work anymore. If we migrated, we wouldn't have to rely on Bower.
  2. all dependencies would be managed by one package manager and could be found in one place.

I would welcome a lively discussion on the issues of whether we should migrate and which package manager to use for the future of this project.

Login attempts return the user to /login/auth/undefined

On some servers, for some users, Steam login will return a user to /login/auth/undefined rather than /login/auth/steam
Manually going to /dashboard will still allow/deny access after seeing this error page, and logs indicate that the login is successful.
Happens after cookies are cleared too.

Multi Instance usage of a bundle for different contexts

Based on the Discord discussion:
In some cases, it can be needed to use a dashboard in multiple contexts, i.e. to feed different twitch streams / channels individually at the same time.
Currently, there is no way to handle this without interfering with the other users and the replicants except for multiple copies of one and the same bundle, replicants (or symlinks) which is hard to maintain and rather ressource heavy.

My idea involved something like an alert window on dashboard load with a dropdown for the "bundle-context" if you want that defines the bundle/data-source nodecg is supposed to pull the values from to allow multiple people to use the same dashboard in different contexts, forcing nodecg to create a set multiple replicant-sets for each context without the need of a new bundle.

Not entirely sure if this is too specific to ask for, thats why opening an issue sounds like a solid way to go right now.

Detect if NodeCG is already running

Trying to run a second copy of NodeCG from the same folder, with the same config, throws errors that aren't caught and can confuse the bundle loader

NodeCG with login Enabled results in Strict MIME type checking is enforced for module scripts

Tried to get NodeCG running on my Server everything works fine so far except for OBS got Problems with the Login.

Tested on: NodeCG 0.8 - 1.3.1

obs-browser: Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec

Source http://localhost:9090/login/:0

Disabling the Login function in NodeCG resolves it but i need it for safety

Problem with installation

Hello everyone,

I wanted to install NodeCG, but I get an error:

git clone [email protected]:github:Lange/json-schema-lib is not a valid repository name

What can I do?

Thank you in advance

An in-range update of @nodecg/bundle-manager is breaking the build 🚨

Version 0.5.6 of @nodecg/bundle-manager just got published.

Branch Build failing 🚨
Dependency @nodecg/bundle-manager
Current Version 0.5.5
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

@nodecg/bundle-manager is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes Beta Release v0.5.6

0.5.6 (2017-08-22)

Bug Fixes

  • fix panel changes in symlinked bundle folders not being picked up (06ffb71)
Commits

The new version differs by 6 commits.

  • 2fa097a chore: update nodecg-bundle-parser
  • 32f5d18 chore: update nodecg-bundle-parser
  • 9c77303 v0.5.6
  • 06ffb71 fix: fix panel changes in symlinked bundle folders not being picked up
  • ace6af3 chore(package): update eslint to version 4.4.0
  • 4e9c516 chore(package): update chai to version 4.0.1 (#23)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Assets Assignable Attribute

When creating a package.json with just a soundCues section specified, the "Sounds" options is not created in the assets tab. When I add a random value under assetCategories both that added category and the "Sounds" option will appear. With the asset section removed from the json the asset page is just blank.

     "soundCues": [
      {
        "name": "sub",
        "assignable": true,
        "defaultFile": "sounds/sub.ogg"
      },
      {
        "name": "tip",
        "assignable": true,
        "defaultFile": "sounds/tip.ogg"
      },
      {
        "name": "cut",
        "assignable": true,
        "defaultFile": "sounds/cut.ogg"
      },
      {
        "name": "out",
        "assignable": true,
        "defaultFile": "sounds/out.ogg"
      }
    ],
    "assetCategories": [
      {
        "name": "testing",
        "title": "Testing",
        "allowedTypes": [
          "ogg",
          "mp3"
        ]
      }
    ]

[Proposal] Run NodeCG without putting bundles inside NodeCG

(Very rough sketching of what could be done to improve)

Currently, the process of developing/setting up NodeCG is:

  1. Clone nodecg/nodecg
  2. cd bundles
  3. Develop/put bundle(s)
  4. cd ../cfg
  5. Write configs
  6. cd ..
  7. node .

Even though some of the process can be simplified with nodecg-cli, there are several thing that can be improved if you can run NodeCG without putting bundles inside NodeCG directory structure.

  1. Have to put bundles and configs separately, by either going back and forth between directories, or opening multiple directories in editor.
  2. Cloning github repository means unnecessary items are downloaded
  3. Have to run npm install twice or more (for NodeCG and bundles)
  4. Cannot share node_modules between NodeCG and bundles, possibly adding huge amount of overloaded files

I have been thinking about how to solve this without breaking changes. Here is my current idea.

  • Publish NodeCG as npm with bower_components included
  • Add bin that runs index.js to NodeCG
  • nodecg.json and ${bundleName}.json in layout's directory
  • Allow bundle directory not to have package.json
  • Each bundle directory has .nodecgrc.json with same config of current package.json's "nodecg" property if the bundle directory doesn't have package.json.

Example of new structure of NodeCG dependent layouts would be like below

bundles
  |- stream-layouts
  |   |- .nodecgrc.json
  |   |- dashboard
  |   |- extension
  |   |- graphics
  |   |- configschema.json
  |- obs-for-qdga2019
  |   |- .nodecgrc.json
  |   |- extension.js
  |   |- configschema.json
bundleConfig
  |- stream-layouts.json
  |- obs-for-qdga2019.json
  |- twitch-helper.json
node_modules
  |- (a bunch of packages)
bower.json
nodecg.json
package.json

where package.json contains

{
  "name": "qdga2019-layouts",
  "private": true,
  "dependencies": {
    "nodecg": "^0.10.0",
    "nodecg-cli": "^5.1.0",
    "nodecg-twitch-helper": "^2.3.4"
  },
  "scripts": {
    "start": "nodecg start"
  },
  "nodecgBundles": {
    "stream-layouts": "bundles/stream-layouts",
    "obs-for-qdga2019": "bundles/obs-for-qdga2019",
    "twitch-helper": "node_modules/nodecg-twitch-helper"
  }
}

Error with running nodecg?

os: Windows 10
node: 7.2.0
nodecg: latest

error:
"""
λ node index.js
[nodecg] No config found, using defaults.
info: [nodecg/lib/server] Starting NodeCG 0.8.5 (Running on Node.js v7.2.0)
Verifying/installing npm deps for bundle toth4-overlay... failed!
Error: Command failed: npm install --production
node-pre-gyp ERR! Tried to download: https://github.com/voodootikigod/node-serialport/releases/download/3.1.2/serialport-v3.1.2-node-v51-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v51 ABI) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (P:\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "P:\nodejs\node.exe" "P:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\build\Release\serialport.node" "--module_name=serialport" "--module_path=C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\build\Release"
gyp ERR! cwd C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport
gyp ERR! node -v v7.2.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\build\Release\serialport.node --module_name=serialport --module_path=C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\build\Release' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:885:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.14393
node-pre-gyp ERR! command "P:\nodejs\node.exe" "C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport
node-pre-gyp ERR! node -v v7.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.28
node-pre-gyp ERR! not ok
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "P:\nodejs\node.exe" "P:\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--production"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
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 serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs serialport
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\npm-debug.log

at checkExecSyncError (child_process.js:488:13)
at execSync (child_process.js:528:13)
at C:\Users\cwilson\Desktop\NodeJS\nodecg\node_modules\@nodecg\bundle-manager\lib\npm_installer.js:27:4
at fs.readdirSync.forEach.bundleFolderName (C:\Users\cwilson\Desktop\NodeJS\nodecg\node_modules\@nodecg\bundle-manager\index.js:144:4)
at Array.forEach (native)
at EventEmitter.module.exports.init (C:\Users\cwilson\Desktop\NodeJS\nodecg\node_modules\@nodecg\bundle-manager\index.js:111:30)
at EventEmitter.module.exports.start (C:\Users\cwilson\Desktop\NodeJS\nodecg\lib\server\index.js:92:16)
at Object.<anonymous> (C:\Users\cwilson\Desktop\NodeJS\nodecg\index.js:29:8)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)

UNCAUGHT EXCEPTION! NodeCG will now exit.
Error: [toth4-overlay] Failed to install npm dependencies: Command failed: npm install --production
node-pre-gyp ERR! Tried to download: https://github.com/voodootikigod/node-serialport/releases/download/3.1.2/serialport-v3.1.2-node-v51-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v51 ABI) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (P:\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "P:\nodejs\node.exe" "P:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\build\Release\serialport.node" "--module_name=serialport" "--module_path=C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\build\Release"
gyp ERR! cwd C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport
gyp ERR! node -v v7.2.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\build\Release\serialport.node --module_name=serialport --module_path=C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\build\Release' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:885:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.14393
node-pre-gyp ERR! command "P:\nodejs\node.exe" "C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\node_modules\serialport
node-pre-gyp ERR! node -v v7.2.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.28
node-pre-gyp ERR! not ok
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "P:\nodejs\node.exe" "P:\nodejs\node_modules\npm\bin\npm-cli.js" "install" "--production"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
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 serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs serialport
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\cwilson\Desktop\NodeJS\nodecg\bundles\toth4-overlay\npm-debug.log

at C:\Users\cwilson\Desktop\NodeJS\nodecg\node_modules\@nodecg\bundle-manager\lib\npm_installer.js:40:11
at C:\Users\cwilson\Desktop\NodeJS\nodecg\node_modules\@nodecg\bundle-manager\lib\npm_installer.js:43:6
at fs.readdirSync.forEach.bundleFolderName (C:\Users\cwilson\Desktop\NodeJS\nodecg\node_modules\@nodecg\bundle-manager\index.js:144:4)
at Array.forEach (native)
at EventEmitter.module.exports.init (C:\Users\cwilson\Desktop\NodeJS\nodecg\node_modules\@nodecg\bundle-manager\index.js:111:30)
at EventEmitter.module.exports.start (C:\Users\cwilson\Desktop\NodeJS\nodecg\lib\server\index.js:92:16)
at Object.<anonymous> (C:\Users\cwilson\Desktop\NodeJS\nodecg\index.js:29:8)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3

"""

Install fails with certain versions of Visual Studio

More for my own reference, if you don't have VS 2010 installed you might get build tool errors. To fix this, just specify the version of VS you have installed.

npm install --msvs_version=2013

Replace 2013 with your versions year.

Bad panel Javascript can break panels injected after it

The work-in-progress OBS Remote panel uses the nodecg.obs API, which isn't in master yet. Using this on master causes the browser to stop executing any Javascript after that panel, breaking any panels injected after it.

Check bundles folder exists & create if it doesn't

NPM removes the bundles & db directories, despite the .empty_directory files. db is created automatically, presumably when bundles.db is created, but bundles is not.

The .empty_directory files should be removed, and NCG should create the folders on startup if they're missing.

Some events wouldn't fire

Was testing the new version tonight just before stream and sometimes events wouldn't fire. I don't know if this is related to THIS issue, but it is an error fired during the test. Streamer was just about to go live so didn't have time to fully dig.

Missing error handler on `socket`.
TypeError: handler.func is not a function
    at /home/node/nodecg/lib/api.js:93:15
    at Array.forEach (native)
    at Socket.<anonymous> (/home/node/nodecg/lib/api.js:90:27)
    at emitTwo (events.js:105:20)
    at Socket.emit (events.js:185:7)
    at Socket.onevent (/home/node/nodecg/node_modules/socket.io/lib/socket.js:335:8)
    at Socket.onpacket (/home/node/nodecg/node_modules/socket.io/lib/socket.js:295:12)
    at Client.ondecoded (/home/node/nodecg/node_modules/socket.io/lib/client.js:193:14)
    at Decoder.Emitter.emit (/home/node/nodecg/node_modules/component-emitter/index.js:134:20)
    at Decoder.add (/home/node/nodecg/node_modules/socket.io-parser/index.js:247:12)

Distribution of NodeCG

NodeCG is mainly distributed through git which brings you many unnecessary files.

Freshly cloned NodeCG consists of these files/folders:

4.0K	.dockerignore
4.0K	.editorconfig
4.0K	.eslintignore
4.0K	.eslintrc
 13M	.git
4.0K	.gitattributes
4.0K	.gitignore
 36K	.idea
4.0K	.jsdoc.json
4.0K	.travis.yml
4.0K	./AUTHORS
 40K	./CHANGELOG.md
4.0K	./CODE_OF_CONDUCT.md
4.0K	./CONTRIBUTING.md
4.0K	./Dockerfile
4.0K	./LICENSE
 12K	./README.md
4.0K	./bower.json
684K	./build
4.0K	./bundles
4.0K	./db
8.0K	./gulpfile.js
4.0K	./index.js
328K	./lib
100K	./media
804K	./package-lock.json
8.0K	./package.json
4.0K	./polymer.json
 12K	./schemas
8.0K	./scripts
284K	./src
1.6M	./test
220K	./tutorials
 32K	./types
 32K	./typetest

And total is 17M.

If you remove unnecessary files

4.0K	./AUTHORS
 40K	./CHANGELOG.md
4.0K	./Dockerfile
4.0K	./LICENSE
 12K	./README.md
4.0K	./bower.json
684K	./build
4.0K	./bundles
4.0K	./db
4.0K	./index.js
328K	./lib
100K	./media
804K	./package-lock.json
8.0K	./package.json
 12K	./schemas
284K	./src
 32K	./types

Total becomes 2.3M, which is about 13% of original size(!).

Since NodeCG itself isn't npm package or bower package, we need our own way to distribute the slimed package.

I think GitHub release would be easy and good solution, but I'm open to any good options

cc @lange

app.use() required middleware functions

I'm getting error below whenever my bundle is loaded in, which then breaks the admin panel and I assume everything else!

The issue doesn't appear to be in my code, as I've tried running with the full code, just the basic initialization of the express app, and no initialization what so ever and they all return the same error.

error: [nodecg/lib/bundles]  TypeError: app.use() requires middleware functions
    at EventEmitter.use (E:\NodeCG\nodecg\node_modules\express\lib\application.js:177:11)
    at E:\NodeCG\nodecg\lib\server\index.js:58:17
    at Array.forEach (native)
    at EventEmitter.<anonymous> (E:\NodeCG\nodecg\lib\server\index.js:57:49)
    at EventEmitter.emit (events.js:92:17)
    at EventEmitter.exports.getExtensions (E:\NodeCG\nodecg\lib\server\extensions.js:61:13)
    at EventEmitter.emit (events.js:95:17)
    at exports.all (E:\NodeCG\nodecg\lib\bundles\index.js:59:17)
    at _fulfilled (E:\NodeCG\nodecg\node_modules\q\q.js:794:54)
    at self.promiseDispatch.done (E:\NodeCG\nodecg\node_modules\q\q.js:823:30)

Dashboard panels not recached if bundle directory is a symlink

This appears to be an issue with however chokidar does globbing (more specifically with **) which is used in bundle-manager, if your bundle is a symlink to another directory then every change to a dashboard panel's HTML file requires a restart of the server. This isn't too much of an issue for production, but it is slightly annoying for development.

Can't get custom fonts loading on the latest version of Chrome

I'm having a lot of difficulting getting custom fonts to load when trying to apply them to custom child Polymer Elements (similar to a molecule in SGDQ2018 layouts). This has only happened since Chrome's latest update.

For example, I have the following:

<dom-module id="omnibar-dual-message">
    <link rel="import" href="../../../../shared/fonts/avenir/stylesheet.css" type="css"/>
    
    <template>
    ...
</dom-module>

Which does not work. I have also tried:

<dom-module id="omnibar-dual-message">
    <link rel="import" href="../../../../shared/fonts/avenir/import.html"/>
    
    <template>
    ...
</dom-module>

Again, with no results.

Am I just forgetting to do something really obvious when I'm trying to get fonts loading?

'nodecg/logger' is not in the npm registry

I just installed nodecg-cli.

when I tried to git a fresh copy of nodecg using nodecg setup I get this error:

$ nodecg setup
Cloning NodeCG... done!
Installing production npm dependencies... failed!
Error: Command failed: npm install --production
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'nodecg/logger' is not in the npm registry.
***npm ERR! 404 You should bug the author to publish it***
npm ERR! 404 It was specified as a dependency of 'nodecg'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Windows_NT 10.0.10586
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! cwd D:\nodecg
npm ERR! node -v v5.3.0
npm ERR! npm -v 1.4.28
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     D:\nodecg\npm-debug.log
npm ERR! not ok code 0

When performing a normal git clone I download nodecg fine, but when I npm install --production I get the same message, but with a different dependency required, instead of /logger I get /bundle-manager

I am very new to nodecg, so I might be missing something, but not sure what at this point?

Thank you. :)

Missing admin Directory In Bundle Crashes

If the admin directory that NodeCG expects to exist in a bundle does not exist, NodeCG will crash. NodeCG should probably check and not load the bundle if it is "incomplete", so to speak.

Handling File Uploads

Assuming some bundles in the future will allow File-uploads (images most likely), where should those be saved on disk?
Should each Bundle handle the file saving itself, or will there eventually be a dedicated folder for shared bundle-connected files in nodecg itself?

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.