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

How to get the root of project which installed my npm module?

I am developing an NPM package. Now I want to know the easiest way to get the root of the project which utilizes my custom package. Within my package itself it is pretty easy to get the root in node.js like so: __dirname This points to the root of…
Stephan-v
  • 19,255
  • 31
  • 115
  • 201
2
votes
1 answer

php laravel/vuejs deployment my vuejs views are not rendering

I have a project using laravel 5.5 and vuejs 2.5.7. Everything is working fine on localhost but on production,my vuejs components are not rendering. All my request are fine, i have only 200. I have done npm run production and set the app.js files…
2
votes
1 answer

Angular 5 proper way to customize node_module .js File

I have searched Google and Stackoverflow. I feel like my question would be common, so perhaps I am not using the proper search terms. In my Angular 5 Project, I have added pdfmake by running npm i --save pdfmake. This has added the expected .js…
Steve B
  • 257
  • 4
  • 13
2
votes
1 answer

Why do node modules have an `@` in the name?

With the release of material-ui version 1, I noticed they have added an @ symbol to the front of the library name @material-ui/core. After digging into my node modules, I see that they aren't the only one - I have @babel and @types as well. Is the @…
Luke Schlangen
  • 3,722
  • 4
  • 34
  • 69
2
votes
0 answers

creating NWJS desktop app with source code protection and use of node.js routes

I am posting this question in the lack of tutorials available for nwjs app development. Also, documentation in not much of a help. There are a few YouTube tutorials but they are 4-5 year old. Since then Node-webkit has changed into nwjs and now…
B L Λ C K
  • 600
  • 1
  • 8
  • 24
2
votes
0 answers

Getting error "Void 0 is not function" on browser when using webpack to bundle typescript file

I am using webpack with 4.8.1 version to bundle typescript which has 2.8.1 version but when i am using that bundled js on browser i am getting error Void 0 is not function.here is my webpack.config.js file var glob =…
2
votes
0 answers

fibers@1.0.15 install node_modules/fibers node build.js || nodejs build.js

I'm have error when trying to run sudo npm install in node 10, in local server its work perfect. error: fibers@1.0.15 install /home/tickets/www/tickets_parser/node_modules/fibers node build.js || nodejs build.js gyp ERR! configure error gyp…
Michael Fedorov
  • 81
  • 2
  • 10
2
votes
2 answers

Restore node_modules folder

I accidentally deleted MyProject/node_modules folder from my solution. Is there any way to recreate this folder? I tried npm install, npm update but no success.
Raphael Lima
  • 179
  • 1
  • 14
2
votes
0 answers

'Mediainfo' permission denied AWS

I have a lambda function for making thumbnails from videos, but I'm encountering some issues when I try to use the mediainfo module. I get the same problem when I test the function /var/task/node_modules/mediainfo-wrapper/lib/linux64/mediainfo:…
2
votes
0 answers

multiple button action to create simple calculator in node js using express web application

I am very new in node Js and I am creating one simple calculator using express . while post call it's not going into the switch case method and not doing the math operation and giving default result. This is my calc.html under public …
2
votes
1 answer

How to correctly configure experimental ECMAScript module so import/export can be used in Node.js

Time is flying and now the Node.js ver.10.0.0 have been out for the public. While I'm working with my MERN stack, frequently I have to switch between ES6 import/export syntax for the front-end (React.JS) and the CommonJS module.exports/require…
Leo Li
  • 247
  • 4
  • 20
2
votes
2 answers

Zeit/pkg: Cannot find module 'config'

I've distilled this issue down to a simple test. I'm using the node "config" module to define configuration values for my app. Pkg doesn't complain on build, but barfs at runtime with the following message. Am I missing…
Jim B.
  • 4,512
  • 3
  • 25
  • 53
2
votes
0 answers

How to add csrf lusca in post response without form? Using hacakthons starter template on github

I am using https://github.com/sahat/hackathon-starter#recommended-design-resources and trying to add post method and send a response as json. I am getting Error: CSRF token missing. I want to use the Lusca and just wondering if there is a way…
Dee
  • 53
  • 7
2
votes
1 answer

Node.js require webpacked modules

I'm trying to get rid of the thousand files you get once you npm install various modules having their own dependencies. Thus I was thinking of compiling only the libraries using webpack into one javascript file (and other required resources), then…
Tot
  • 873
  • 2
  • 13
  • 30
2
votes
5 answers

No version of composer-cli has been detected

All, After following the instructions in this page: Installing the Development Environment to install Hyperledger Composer, I encountered this error every time I use sudo ./createPeerAdminCard.sh I am sure that I have installed the correct…
1 2 3
99
100