nerd icon indicating copy to clipboard operation
nerd copied to clipboard

Are NPM Packages supported?

Open bogacg opened this issue 5 years ago • 4 comments
trafficstars

I'm getting error in form:

[*] Generating source file
[!] Require error :chalk

Chalk is an NPM package and my code is compiled from TS, which generated a line: const chalk = require("chalk"); where the error occurs.

Is it even possible to use other NPM packages in NectarJs apps?

NectarJS ver. 0.5.31

bogacg avatar May 18 '20 23:05 bogacg

hi @bogacg , One of the goals of NectarJS is to support as many node modules as possible, and as many EcmaScript standards as possible,

We start to add a {nectar: {}} property in the package.json of module to say if it's compatible or not with NectarJS.

I will update this issue with the state of node modules support

adrien-thierry avatar May 18 '20 23:05 adrien-thierry

I get this error too.

My code:

// Generated by CoffeeScript 2.5.1
var prompt;

prompt = require("prompt");

prompt.start();

prompt.get(["username"], function(error, hasil) {
  return console.log(`Username: ${hasil.username}`);
});

And the error:

[*] Generating source file
[!] Require error : prompt

I use this command:

nectar ask.js

mzaini30 avatar May 19 '20 04:05 mzaini30

Most likely all NPM packages that use stdout, stdin or stderr will fail.

marcus-sa avatar Jun 11 '20 13:06 marcus-sa

@marcus-sa we integrated libuv with node env, so it's just a matter of time now to support NPM packages

adrien-thierry avatar Jun 11 '20 14:06 adrien-thierry