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
5 answers

git status is not showing my changed files

I have a Node.js project and have imported a few Node modules. The git_status command shows the files that I changed in the project. I have also changed some files under the node_modules directory but those are not shown. The node_modules directory…
Chirayu Sharma
  • 75
  • 1
  • 11
2
votes
1 answer

Why we need main property in package.json at node application's root, if it is for telling packages and module's entry point?

If the main field in package.json file is neccessary for telling the entry point point of packages then why we include this field in package.json in node application's root. Do nodejs considers our node application as a package or a module?
mohit kaushik
  • 363
  • 2
  • 13
2
votes
1 answer

Could not find a declaration file for module 'react-native-foo-package'

while I added any component to my pure react-native project, the application screen turns to the white empty page. The import 'react-native-foo-package' line has '...' near the package name, and it has this message: [ts] not find a declaration…
2
votes
1 answer

How to install/download packages without using npm install or yarn install

I work in a banking domain company so here many link and websites are blocked. Currently I am working on a project where I am using react and Node.js as tech stack. So whenever I want to install any new dependency or just npm install I get access…
iamelix
  • 43
  • 1
  • 7
2
votes
1 answer

Error - Unknown listen EADDRINUSE :::5432 in Windows Powershell

On running gulp serve --nobrowser, I get the following error: { Error: listen EADDRINUSE :::5432 at Object._errnoException (util.js:992:11) at _exceptionWithHostPort (util.js:1014:20) at Server.setupListenHandle [as _listen2] (net.js:1355:14) at…
user989988
  • 3,006
  • 7
  • 44
  • 91
2
votes
1 answer

Node module doesn't work after webpack build

I'm having some problems with building own node module for my react apps. I need this to prepare some common functions for couple of my react apps and I want them to be placed in separated node module. So, I created the module and it looks like…
2
votes
2 answers

Disable directory "node_modules" ignoring in Babel

I use webpack4 + babel7. In my JS script I need to import NPM module. This module uses ES6 classes and modules. And after building bundle this class not transpiling to standart functions. How to make the NPM module I need was completely…
LV426
  • 121
  • 2
  • 6
2
votes
1 answer

Cannot load Node native addons with webpack

Although I am using vue-cli in the example code to generate a webpack config, nothing is specific to vue. I create the example app like this: vue init webpack webpack_modules_example Generated webpack.base.conf: 'use strict' const path =…
Cornwell
  • 3,304
  • 7
  • 51
  • 84
2
votes
1 answer

How to make node_modules global instead of the folder residing inside your project

I am working on lots of nodejs application and I save all my project on Google Drive (for a personal reasons, not efficiency) but I don't like that my drive is filled with thousands of similar modules that live inside node_modules folder. I was…
entegra
  • 305
  • 1
  • 3
  • 9
2
votes
2 answers

Inspect an Express.js app that uses import

I have an app that contains the following in index.js: import express from 'express'; import data from './data/data.json'; const app = express(); const PORT = 3000; How can I access the data variable for testing purposes? This answer given on SO…
Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232
2
votes
1 answer

TypeError: undefined is not a function while logOn to steam

I am working on steam project. For that I am using node-steam module. I am stuct at login part. I getting this exception while I am trying to logOn to steam account using node-steam Exception as follow: Uncaught TypeError: undefined is not a…
Priyanka
  • 31
  • 2
2
votes
0 answers

How to Integrate node module with chrome extension

I'm developing a google chrome extension that needs some node modules in order to run. These modules have been downloaded with npm.
2
votes
1 answer

How do node modules packages import dependencies?

Currently in the process of migration Material-UI from v0 to v3, I'm facing multiple issues of files importing dependencies from the wrong location. Let's take the @babel/runtime dependency as an example. Below are extracts of my package.json and…
Adrien Lemaire
  • 1,744
  • 2
  • 20
  • 29
2
votes
0 answers

Heroku Failed To Build -Node

i'm trying to host my website through heroku, but the build is failing constantly whatever i do.The build works locally, but when i tried to push to heroku i keep getting this Counting objects: 1324, done. Delta compression using up to 4…
BIRUK
  • 21
  • 3
2
votes
1 answer

Typescript cannot find module in node_modules that I created myself locally

I'm teaching myself more about how to create node modules and how to use typescript. To accomplish this, I've attempted to create my own node module locally, and reference it in a project - however, typescript doesn't seem to recognize my…
MWinstead
  • 1,265
  • 6
  • 12
  • 27