Questions tagged [node-modules]

Node.js has a simple module loading system that reduces complexity of applications and promotes code reusability.

Node.js has a simple module loading system that reduces complexity of applications and promotes code reusability. In Node.js, files and modules are in one-to-one correspondence.

For example, foo.js loads the module circle.js in the same directory:

The contents of foo.js:

var circle = require('./circle.js');
console.log( 'The area of a circle of radius 4 is ' + circle.area(4));

The contents of circle.js:

var PI = Math.PI;

exports.area = function (r) {
  return PI * r * r;
};

exports.circumference = function (r) {
  return 2 * PI * r;
};

Node.js also has an incredible community of open source developers who publish packages using :

6621 questions
2
votes
1 answer

Import libraries/modules in Angular

In Angular import { Observable } from "rxjs"; what exactly does? To my understanding it should execute file Observable.ts, however there is no such file inside "node_modules/rxjs". Of course, the same query applies to all import statements. For…
Unknown developer
  • 5,414
  • 13
  • 52
  • 100
2
votes
3 answers

Use glob node.js to know if a file exists in the parent folder using wildcard

I need to search in the parent folder of where a node.js yeoman generator script is running to see if a file exists, but I won't know the file name - only the extension. Glob: https://www.npmjs.com/package/glob Folder Structure: C:\Work\…
Will Strohl
  • 1,646
  • 2
  • 15
  • 32
2
votes
1 answer

When splitting code to a custom module in Nodejs when trying to pass a variable to another module its get undefined

I have a aws lambda that I use to disable a AWS cloudwatchevents . It works fine when I am not using custom modules when I tried using custom modules I get undefined for a variable I need in another module. What I am doing wrong ? var myRuleparams…
user3277530
  • 351
  • 6
  • 14
2
votes
0 answers

could not install tensorflow.js @tensorflow/tfjs-node

I could not install library of tensorflow.js module in my project, in local machine. It's portraying the problem as follows: Building TensorFlow Node.js bindings C:\mlwithjs\tensorflowjs\node_modules\@tensorflow\tfjs-node\scripts\install.js:176 …
2
votes
5 answers

Installation issue in Nativescript

Hi I am using Mintos(Linux) platform. For create Andriod app Angular based using Nativescript so i installed Nativescript successfully installed node.js version 8.10.0. When i tried to install nativescript cmd npm install -g nativescript It was…
2
votes
2 answers

is it possible to share same node modules between multiple projects?

As of now I am installing node modules every time for the new angular project. Is it possible to use one projects node modules to other project by configuring any file(like changing the path in any file so it can use that modules)?
Pujan Shah
  • 775
  • 10
  • 15
2
votes
1 answer

Changing nodemailer "from" filed to a variable

Could be what I want to do is totally Impossible but I am a newbie so please understand, thanks. Basically as you can see in my code, that replyTo and subject have a variable from where the information will be pulled from rather than plain text. I…
BeckyP
  • 23
  • 4
2
votes
1 answer

Browser cannot find imported javascript package, generates error 404

I'm trying to build a webpage that imports and uses a JS package, following a tutorial for LiveChat. This says to import using import LiveChat from '@livechat/agent-app-widget-sdk'; However that results in this error: Uncaught TypeError: Failed…
2
votes
1 answer

Insert multiple entries to SQL Server with Node.js

I am rewriting an old API for which I am trying to insert multiple values at once into a MSSQL-Server (2008) database using the node module mssql. Now, I am capable of doing this somehow, but I want to this following best practices. I've done my…
2
votes
1 answer

Artillery.io value obtained on 'capture' not available at 'expect'

I'm quite new to the artillery.io and I'm getting a problem. I want to get a value from the JSON response and check it on the 'expect' clause, so I'm doing that like this: config: target: 'https://api.duckduckgo.com' plugins: expect: {} …
Rodolfo
  • 1,091
  • 3
  • 13
  • 35
2
votes
1 answer

Properties and methods on exported typescript classes don't exist (TS 2339)

I have a module which is a collection of helper classes, each defined in their own files: controller.ts, stateService.ts and so on. From what I gather the way to have them all exported is to create an index.ts that imports all of them and then…
MysteriousWaffle
  • 439
  • 1
  • 5
  • 16
2
votes
1 answer

Request calling a function that uses Request

In my code below, I am trying to call an API and from that API I call another API using Request. Is there a way the return from the second call is available to the first call. app.get("/secure", function (req, response) { console.log("Call to…
Pranam Codur
  • 51
  • 1
  • 6
2
votes
1 answer

how to reduce size of node_module in angular app and load Node_Modules from index.html or application root

I want to reduce size of node_module (current size 605MB) and load Node_Modules from index.html or application root. Angular 5 node 8.9.4 I tried few solutions but not giving expected result, npm install…
Tejal
  • 471
  • 4
  • 10
2
votes
0 answers

Devtron is unable to load the processes graph

I am learning to use Eletron and I found very useful this debugging tool: Devtron. But it not works and I don't know if it is a bug or I am not using it correctly. The installation guide from Devtron's website says: # Install Devtron $ npm install…
shogitai
  • 1,823
  • 1
  • 23
  • 50
2
votes
1 answer

Node.js execute .lnc file

There was a problem when opening a shortcut (.lnk) through node.js. How should I open it? var exec = require('child_process').execFile; var runLibreOffice =function(){ exec('D:\\Downloads\\bot\\botgo.lnk', function(err, data) { …