Skip to content

Using elixir-nodejs #78

@nitishymtpl

Description

@nitishymtpl

Hi, I am having difficulty configuring elixir-nodeJS.

Here is what, I did in Application.ex.

%{
id: NodeJS,
start: {NodeJS, :start_link, [[path: "/workspace/lib/keila/JS", pool_size: 4]]}
}

In demos.ex

defmodule Keila.Demos do
import NodeJS
def add_and_print do
result = NodeJS.call("echo", ["hello"]) #=> {:ok, "hello"}
IO.puts "The sum is #{result}"
end
end

But the error is coming as:

iex(1)> c("demos.ex")

== Compilation error in file demos.ex ==
** (CompileError) demos.ex:2: module NodeJS is not loaded and could not be found

** (CompileError) compile error
(iex 1.14.4) lib/iex/helpers.ex:204: IEx.Helpers.c/2
iex:1: (file)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions