Hubot with hipchat adapter not starting on ubuntu - node.js

I'm not very well versed in nodejs, but I'm trying to install hubot and run it with the hipchat adapter but, I'm getting the following error, package.json below.
I've followed this tutorial, http://theprogrammingbutler.com/blog/archives/2011/10/28/hipchat-hubot-and-me/ and the official one in the hubot-hipchat repo, https://github.com/hipchat/hubot-hipchat - I even tried setting it up on heroku to no avail. I'd prefer to set it up on my ubuntu 12.04 ec2 instance though, but if someone has a surefire way to heroku it's no problem :) Any help is greatly appreciated!
I've set the following environment variables also.
HUBOT_HIPCHAT_JID=<Username>
HUBOT_HIPCHAT_NAME=<Room nickname>
HUBOT_HIPCHAT_PASSWORD=<Password you created for hubots user>
HUBOT_HIPCHAT_TOKEN=<Token from Group Admin and API>
Error:
Error: Argument error
at new JID (/home/ubuntu/falcbot/node_modules/hubot-hipchat/node_modules/node-xmpp/lib/xmpp/jid.js:30:15)
at new Connector (/home/ubuntu/falcbot/node_modules/hubot-hipchat/src/connector.coffee:64:31, <js>:42:13)
at HipChat.run (/home/ubuntu/falcbot/node_modules/hubot-hipchat/src/hipchat.coffee:48:5, <js>:68:19)
at Robot.run (/home/ubuntu/falcbot/node_modules/hubot/src/robot.coffee:389:5, <js>:351:27)
at Object.<anonymous> (/home/ubuntu/falcbot/node_modules/hubot/bin/hubot:124:8, <js>:141:11)
at Object.<anonymous> (/home/ubuntu/falcbot/node_modules/hubot/bin/hubot:5:1, <js>:144:4)
at Module._compile (module.js:456:26)
package.json
{
"name": "hosted-hubot",
"version": "2.6.3",
"author": "GitHub Inc.",
"keywords": [
"github",
"hubot",
"campfire",
"bot"
],
"description": "A simple helpful robot for your Company",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/github/hubot/raw/master/LICENSE"
}
],
"repository": {
"type": "git",
"url": "https://github.com/github/hubot.git"
},
"dependencies": {
"hubot": "2.6.3",
"hubot-scripts": "2.5.3",
"hubot-hipchat": "2.5.1-4",
"optparse": "1.0.4"
},
"engines": {
"node": ">= 0.8.x",
"npm": ">= 1.1.x"
}
}

Apparently I forgot to export the variables. I am now not getting any errors when starting hubot with -a hipchat

Related

How to use a reason module from local package

I’m looking for a way to use a local package (named bs-package) from my Reason React app (named ApplicationA).
bs-package has a single file within src folder called ModuleA.re :
let greet_me = (me) => Js.log("Hello, " ++ me ++ "!");
In ApplicationA I did :
npm install /path/to/bs-package
In node_modules bs-package now appears as symbolic link.
Then added bs-package to bs-dependencies in bsconfig
"bs-dependencies": [
"reason-react",
"bs-package",
],
Then run make world in ApplicationA
bsb -make-world
Now in my Reason React app
ModuleA.greet_me("John");
Gives me
unbound module ModuleA
What am I missing ?
EDIT
Here is the config file of bs-package
It was created with
bsb -init bs-package -theme basic-reson
bsconfig.json
{
"name": "bs-pacakge",
"version": "0.1.0",
"sources": {
"dir" : "src",
"subdirs" : true
},
"package-specs": {
"module": "commonjs",
"in-source": true
},
"suffix": ".bs.js",
"bs-dependencies": [
],
"warnings": {
"error" : "+101"
},
"namespace": true,
"refmt": 3
}
package.json
{
"name": "bs-pacakge",
"version": "0.1.0",
"scripts": {
"build": "bsb -make-world",
"start": "bsb -make-world -w",
"clean": "bsb -clean-world"
},
"keywords": [
"BuckleScript"
],
"author": "",
"license": "MIT",
"devDependencies": {
"bs-platform": "^5.0.6"
}
}
As suggested, bs-package is namespaced so this should work
BsPackage.ModuleA.greet_me("name")
But the same error appears
unbound module BsPackage
Apparently the bug came from my bs-platform version. I've just switch from version 6.2.1 to version 7.0.1 and everything works fine now (I'm on Windows).

NPM nested dependency

I am developing a module that I try to make as generic as possible (let's say BaseModule), and I want to extend it to feet my current purposes in another module (let's say ChildModule).
So ChildModule begins with:
require('BaseModule');
So I added BaseModule as a dependency of ChildModule. But when I want to use both of them on my real project, I cannot install both of them. Installing BaseModule removes ChildModule, and installing ChildModule moves BaseModule, in a way it is unreachable in my code afterward.
Both the module are on a git repository only (ie not published yet).
What is funny is that mongoose is also a dependency of ChildModule, and I don't have this issue. So I think I forgot something in BaseModule, but I don't know what...
It is a bit similar to this issue NPM dependencies shared by dependencies, which is supposed to be fixed on my NPM version (5.6). This issue is also similar, but as I said before I don't think it is a bug.
Is there any way to have nested dependency? If no, what is the standard way to do this kind of extension?
Here are the different package.json:
BaseModule's package.json
{
"name": "BaseModule",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+ssh://.../BaseModule.git"
},
"bundledDependencies": false,
}
ChildModule:
{
"name": "ChildModule",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+ssh://.../ChildModule.git"
},
"bundledDependencies": false,
"dependencies": {
"mongoose": "^4.13.9",
"BaseModule": ".../BaseModule"
}
}
and the project itself:
{
"name": "Project",
"dependencies": {
"mongoose": "^4.13.9",
"ChildModule": ".../ChildModule",
"BaseModule": ".../BaseModule",
"andALotMore": "*"
}
}
... stands for the correct address of my repositories.

Deploy .Net Core MVC app w/ class library to Ubuntu 16.04:

I wanted to build a simple .net core MVC app with a single class library for data access, to get an idea of what it takes to build/deploy/run Core on Linux. Not nearly as simple as I had hoped!
EDIT: Here's a copy of the solution, if anyone is interested:
https://s3.amazonaws.com/kilonova-public/code/CoreCrossPlatform.zip
I threw together a VirtualBox VM w/ Ubuntu Server 16.04 and installed dotnet core per these instructions:
https://www.microsoft.com/net/core#ubuntu
I installed all the latest, necessary bits on the host (Win10) for VS 2015 and created a solution with an MVC app and single class library called "DataAccess". It's EF Core talking to MySQL using their latest core provider. It all runs flawlessly on the Win10 host when I run/debug it. Pulls up data and looks great.
"dotnet --version" on both the host and the VM gives me:
1.0.0-preview2-003121
However, when I deploy it to the Ubuntu VM, I get the following error on the class library dependency:
Project corecrossplatform (.NETCoreApp,Version=v1.0) will be compiled because the version or bitness of the CLI changed since the last build
Compiling corecrossplatform for .NETCoreApp,Version=v1.0
/opt/dotnet/corecrossplatform/project.json(24,23): error NU1002: The dependency DataAccess does not support framework .NETCoreApp,Version=v1.0.
Compilation failed.
0 Warning(s)
1 Error(s)
Time elapsed 00:00:00.0187782
This happens whether I run "dotnet restore" or "dotnet run". To be perfectly honest, I'm not even sure I'm deploying this thing correctly. Documentation is spotty and I'm making some guesses. I copied everything from the project folder "src\CoreCrossPlatform" (contains bin, Program.cs, appsettings.json, etc.) onto the VM and this is where I'm executing the "dotnet" commands from, in the VM.
The DataAccess .json file:
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.EntityFrameworkCore": "1.0.0",
"MySql.Data.Core": "7.0.4-IR-191",
"MySql.Data.EntityFrameworkCore": "7.0.4-IR-191",
"NETStandard.Library": "1.6.0"
},
"frameworks": {
"netstandard1.6": {
"imports": "dnxcore50"
}
}
}
The MVC project.json:
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"DataAccess": "1.0.0-*"
},
"tools": {
"BundlerMinifier.Core": "2.0.238",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "dotnet bundle" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
Something to note: When I run the sample project using "dotnet new" and restore, run vis the tutorial link above, it runs fine.
What am I missing? Another side question: What's the best way to publish this type of app to a Linux box? Am I even close on that part?
Thanks much.
EDIT: While kicking this dead horse all afternoon, I compared some notes I found online, related to this "NU1002" error, and the sample project "dotnet new" generates. I tried changing the "framework" section of both project.json files (MVC and classlib) to the following, with no success...same error:
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"imports": [
"dnxcore50",
"dotnet5.6",
"portable-net45+win8"
]
}
}
EDIT: Much thanks to goaty: As he pointed out in the comments, copying over the entire solution and building it, results in a successful build. However, I cannot run it without an error. It doesn't seem to restore the MySQL EF Core dependency:
Project CoreCrossPlatformFlat (.NETCoreApp,Version=v1.0) will be compiled because the version or bitness of the CLI changed since the last build
Compiling CoreCrossPlatformFlat for .NETCoreApp,Version=v1.0
/opt/dotnet/corecrossplatform/src/CoreCrossPlatformFlat/project.json(25,52): error NU1001: The dependency MySql.Data.EntityFrameworkCore >= 7.0.4-IR-191 could not be resolved.
Compilation failed.
0 Warning(s)
1 Error(s)
The DataAccess library exists outside of your src/ directory. Therefore the web project could not find the reference.
I recommend this structure
src/
|---DataAccess/
|---CoreCrossPlatform/
Hope that helps :)

what is the manifest JSON of the bower package management

On the Site bower.io,it says "There must be a valid manifest JSON in the current working directory." What does that mean? What is a manifest JSON?
This is referring to the bower.json file. This is a a sample of that:
{
"name": "my-project",
"version": "1.0.0",
"main": "path/to/main.css",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<name>": "<version>",
"<name>": "<folder>",
"<name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}

Execution of a node package command not working on Ubuntu 12.04 RTS

I have created a npm package, Here is the package.json:
{
"name": "docxgen",
"version": "1.0.5",
"author": "Hans Thunam <hans.thunam#gmail.com>",
"description": "A docX Generator",
"contributors": [
{
"name": "",
"email": ""
}
],
"bin":
{
"docxgen":"./docxgenNode/bin/docxgen"
},
"keywords": [
"DocX",
"templates",
"Generator"
],
"dependencies" : {
"xmldom" : "0.1.x"
},
"devDependencies": {
"jasmine-node":"1.10.x"
},
"license": "MIT",
"engines": {
"node": ">=0.8"
}
}
Then I did sudo npm install -g in the folder of package.json, the installation worked correctly (no error nor warnings).
Howewer, when I then try to execute docxgen file.docx file.json, I get the response: File or command not found. What is strange about this is that it works on Windows 7.
Is there anything different to do for Ubuntu ?
The issue was about the character encoding of the ./docxgenNode/bin/docxgen.
The shell system didn't read the first line correctly.
I started from an existing working binary file that can be found here: https://github.com/LearnBoost/stylus/blob/master/bin/stylus

Resources