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

Importing module that extends a class

While looking for a way to rotate markers in leaflet.js, I found the module leaflet-rotatedmarker. I installed it via npm, but now I don't know how to actually use it. As per the readme, it only extends the existing Marker class. To my…
mneumann
  • 713
  • 2
  • 9
  • 42
2
votes
1 answer

Nuxt Sass/Scss @imports inside imported node_modules

I'm trying to use the Sass parts of Material design official library inside my Nuxt project. I have created a file inside assets folder called styles.scss and tried to import a simple component like this : @import…
julient-monisnap
  • 774
  • 2
  • 8
  • 25
2
votes
2 answers

Regex exp to change every letter after the literal dot [.] to lower case

Could anyone help out with regex expression I can run in node to change that changes only the letter that appears immediately after the dot(.) to lower-case? I am reading And writing back the changed text back to the same text…
Eva
  • 109
  • 9
2
votes
3 answers

Minifying html and CSS onto a single line in Node.js

Is there a module or gulp option which can minify html and css into a single line? For example
user6248190
  • 1,233
  • 2
  • 16
  • 31
2
votes
2 answers

Getting error while connection to Ibm_db2 from a Node js platform

I am trying to connect to a DB2 server but I am getting bellow given error. I'm following the given documentation: npm db2 Doc I have done npm i ibm_db2 Code: const ibmdb = require('ibm_db'); const connectQuery = 'DATABASE=' + DATABASE…
KRUSHANU MOHAPATRA
  • 552
  • 1
  • 6
  • 18
2
votes
0 answers

Google Cloud Speech to Text API - Speaker Diarization

When i am trying to do a speech to text transcribe of a live phone call using web socket. Already included const Speech = require('@google-cloud/speech').v1p1beta1; const speech = new Speech.SpeechClient(); With following config. encoding:…
2
votes
0 answers

Monorepo of react native cli and react working - modules not exist in the haste module | YarnWorkspace

I am creating the monorepo with react native clic and react js. I am facing the below error , though i dont face any issue with build as its successful. I am using Wml An alternative to symlinks that actually copies changed files from source to…
supersaiyan
  • 1,670
  • 5
  • 16
  • 36
2
votes
1 answer

react-google-maps Module not found: Can't resolve 'react-google-maps/lib/places/SearchBox'

I have a create-react-app which uses react-google-maps. What I want to do is to import SearchBox from 'react-google-maps/lib/places/SearchBox' but I'm getting the following error: Module not found: Can't resolve…
Nazar
  • 21
  • 2
  • 5
2
votes
0 answers

Is there a way to build node_modules using webpack on backend ( node js )?

I am using webpack 4.32 for node js. So far the code is properly built when i exclude node_modules, but i want node_modules also to be built in webpack so that when moved to cloud there is no need of installing every time. Excluded node_modules…
2
votes
4 answers

Getting started with Create React App - "Cannot find module"

I'm using the "Getting Started" guide because I've been experiencing endless errors trying to create a react app so far when following tutorials. And straight away I'm running into a problem. When I run npx create-react-app my-app I get the…
Aristophanes
  • 475
  • 1
  • 9
  • 21
2
votes
1 answer

Fail to import typescript module built from bazel

I try to build a node module using @bazel/typescript and npm_package rules of bazel using bazel build //core:package. Below is my BUILD file package(default_visibility = ["//visibility:public"]) load("@npm_bazel_typescript//:index.bzl",…
eded
  • 3,778
  • 8
  • 28
  • 42
2
votes
3 answers

Is it posible to edit files in node_modules permanently?

I want to edit and remove some rows of code's from my node-modules but everytime I 'nmp install' my code will be overwriten. Is there a solution to edit files in my node-modules without overwriting them every time? For example i wanna…
Levi Roest
  • 35
  • 2
  • 5
2
votes
1 answer

How to create import map with jspm2

I am trying to import javascript packages from npm using JSPM module loader and use offline package loader instead of CDN. now I want to add an importmap script so I can import react or another module in my module like: import React from…
javad bat
  • 4,236
  • 6
  • 26
  • 44
2
votes
1 answer

Is there an npm package that will convert unstructured data to csv?

Trying to export some data into csv in Javascript. Trying to find a npm module to do this... however - the data I have could have different headers per row... for example my data could be this: [ { name: 'John', color: 'Blue', age: 25 }, { name:…
deblearns1
  • 103
  • 1
  • 10
2
votes
1 answer

FetchError: request to https://discordapp.com/api/v7/gateway/bot failed, reason: read ECONNRESET

I'm working with a Discord bot using the node.js module discord.js. Recently an error appears on start up (when the bot attempts to login) when using the work wifi which I believe was configured in some way that caused it to break. (node:104)…
user7393973
  • 2,270
  • 1
  • 20
  • 58