Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
916 votes
12 answers
668k views

Error "npm WARN package.json: No repository field"

I installed Express.js with the following command: sudo npm install -g express I get the following warnings: npm WARN package.json [email protected] No repository field. npm WARN package.json fresh@...
JR Galia's user avatar
  • 17.3k
245 votes
4 answers
143k views

Purpose of installing Twitter Bootstrap through npm?

Question 1: What exactly is the purpose of installing Twitter Bootstrap through npm? I thought npm was meant for server side modules. Is it faster to serve the bootstrap files yourself than using a ...
James Fazio's user avatar
  • 6,420
210 votes
29 answers
767k views

npm can't find package.json

I'm trying to install the dependencies of some example: npm's express 2.5.8 that I've downloaded, but all of the apps throw the same error: c:\node\stylus>npm install -d npm info it worked if it ...
imjp's user avatar
  • 6,665
201 votes
34 answers
372k views

ExpressJS - throw er Unhandled error event

I created expressjs application using the following commands: express -e folderName npm install ejs --save npm install When I run the application with: node app.js, I have the following errors: ...
JR Galia's user avatar
  • 17.3k
195 votes
2 answers
130k views

Difference between `npm start` & `node app.js`, when starting app?

I have installed an application using the command express new 'filename'. I have just learned that you can start an application using: npm start Thus far I have used: node app.js to start my ...
ReneGAED's user avatar
  • 2,246
171 votes
15 answers
443k views

Node.js Error: Cannot find module express

I wrote my first node.js app, but it can't find express library: C:\ChatServer\Server>node server.js module.js:340 throw err; ^ Error: Cannot find module 'express' at Function....
Dmitry's user avatar
  • 7,545
169 votes
22 answers
341k views

nodemon not working: -bash: nodemon: command not found

I'm on a Mac running El Capitan. I have node v5.6.0 and npm v3.6.0. When I try to run nodemon, I get: -bash: nodemon: command not found I thought this may mean that I didn't have nodemon installed,...
Brian O'Neill's user avatar
107 votes
3 answers
138k views

npm start vs node app.js

I'm extremely new to Node and trying to get my head around app basics. I'm curious as to why these two commands: node app.js --vs-- npm start output the same thing to the console and appear to ...
dudewad's user avatar
  • 13.6k
102 votes
3 answers
101k views

How to organise file structure of backend and frontend in MERN

I have backend based on express + mongoose. File structure is: - /models -- item.js - /node.modules -- ... - server.js - package-lock.json - package.json And regular create-react-app based folder ...
Angelzzz's user avatar
  • 1,446
89 votes
6 answers
97k views

What is the difference between res.send and res.write in express?

I am a beginner to express.js and I am trying to understand the difference between res.send & res.write ?
P G's user avatar
  • 948
88 votes
18 answers
115k views

How to store a file with file extension with multer?

Managed to store my files in a folder but they store without the file extension. Does any one know how would I store the file with file extension?
user3355603's user avatar
  • 1,161
49 votes
2 answers
28k views

Difference between a server with http.createServer and a server using express in node js

What's the difference between creating a server using http module and creating a server using express framework in node js? Thanks.
Koushik Das's user avatar
  • 10.5k
47 votes
14 answers
69k views

Express module not found when installed with NPM

When I try to run the app.js file created by express, I get the following error: $ node app.js node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: ...
Kelp's user avatar
  • 1,268
47 votes
4 answers
66k views

run-p: command not found

after installing 'npm install webpack-dev-server -g' not able to start expressjs project. I am using below script: "scripts": { "start": "run-p watch dev-server", "watch": "webpack --config ...
Full Stack Developer's user avatar
43 votes
2 answers
41k views

npm install not installing latest version on GitHub

I have a module called 'sails-mongo' and I want to update it to the newest version using the following command: npm update sails-mongo --save I also tried uninstall then install again. I tried sails-...
user2867106's user avatar
  • 1,139
39 votes
3 answers
34k views

Npm "scripts": "start" run express and open url

I have this entry in package.json "scripts": { "start": "node bin/www" }, It runs my Express app when I enter the command npm start. But I also want a browser to ...
Sergino's user avatar
  • 10.6k
35 votes
18 answers
59k views

NPM, cannot find 'graceful-fs', no matter what I do

This is what I get when I try to install express for node.js npm install express module.js:340 throw err; ^ Error: Cannot find module 'graceful-fs' at Function.Module....
Collin McGuire's user avatar
33 votes
2 answers
26k views

TypeError: Request path contains unescaped characters

I try to install node.js modules using: npm install express but I get this error: npm http GET https://registry.npmjs.org/express npm ERR! TypeError: Request path contains unescaped characters. npm ...
Walter Caraza's user avatar
33 votes
1 answer
4k views

Firebase Cloud Functions - slow response when querying Firestore

I have a simple Cloud Function in Firebase that takes JSON in an http POST and saves it to a Firestore collection. It's allocated 512MB memory. The performance of this cloud function is very poor. If ...
James Beswick's user avatar
30 votes
12 answers
75k views

package.json must be actual JSON, not just JavaScript

I used http://jsonlint.com/ to check the syntax for this package.json file { "name": "hello-world", "description": "hello world test app", "version": "0.0.1", "private": true, "dependencies"...
nmolloy93's user avatar
  • 401
30 votes
4 answers
65k views

Node Mysql Cannot Enqueue a query after calling quit

where do i close the mysql connection? I need to run queries in sequence. I am writing code that looks like this at present: var sqlFindMobile = "select * from user_mobiles where mobile=?"; var ...
Kinjal Dixit's user avatar
  • 7,907
29 votes
3 answers
39k views

NPM how to update/upgrade transitive dependencies?

I am using express v4.16.4 in my node server. It has pulled in cookie-signature v1.0.6. I want to upgrade cookie-signature to v1.1.0 as it has a fix which I require. What is the way to do that ? ...
gaurav5430's user avatar
  • 13.6k
28 votes
7 answers
39k views

express command not found in bash after installing it with npm

just installed new ubuntu vm to test around with node installed things in this order: node mongodb-server npm express mongoose now, trying to create a new app i noticed express cannot be used in the ...
Sander's user avatar
  • 13.4k
28 votes
5 answers
65k views

How to close electron app via javascript?

I am running an express app via electron. Below is the main.js const electron = require("electron"), app = electron.app, BrowserWindow = electron.BrowserWindow; let ...
code_legend's user avatar
  • 3,245
28 votes
5 answers
27k views

TypeScript: Extend Express.Session interface with own class

I'm working on a Typescript project with npm packages. I want to add a property to the Express.Session interface. example Class: class User { name: string; email: string; password: ...
Mr. Smith's user avatar
  • 639
27 votes
3 answers
37k views

TypeError [ERR_UNESCAPED_CHARACTERS] Request path contains unescaped characters

I am working on Ubuntu with incoming HTTP request from the following URL: http://<MY-IP>:3000/v1/projects/list Description: The problem is that I get the following error in terminal: TypeError [...
Hlib Derbenov's user avatar
26 votes
4 answers
73k views

How do I create a MySQL connection pool while working with NodeJS and Express?

I am able to create a MySQL connection like this: var mysql = require('mysql'); var connection = mysql.createConnection({ host : 'localhost', user : 'me', password : 'secret',...
Utkarsh Kaushik's user avatar
23 votes
6 answers
18k views

Can we configure multer to not store files locally and only for using req.files.image.path?

My application's need is as follows: I upload the image to Cloudinary and store the url of image in my mongodb database. To upload the image to cloudinary, I needed to give the file path, and for ...
Aravind's user avatar
  • 3,171
22 votes
5 answers
35k views

node . and npm start don't work

The title says most of the problem. When I try to run node . I get: module.js:340 throw err; ^ Error: Cannot find module 'static-favicon' at Function.Module._resolveFilename (...
Bren's user avatar
  • 3,636
22 votes
2 answers
9k views

Difference between Express and Connect npm packages

I have been using express webservers since I started working on Node.js and a few days ago I came across this new (to me) web server, called connect. Can anyone point out, what are the differences ...
Harshal Yeole's user avatar
20 votes
2 answers
21k views

install express with npm

I recently installed nodejs version 0.10.26 on ubuntu 64 bit. node -v and npm -v commands run fine and I can see the correct versions. When I do a $ sudo npm install -g express the installation goes ...
trailblazer's user avatar
  • 1,431
19 votes
1 answer
37k views

NPM PROBLEM: Node-pre-gyp. Using request for node-pre-gyp https download

I am creating Angular project and using Express.js as back-end and SQLite3 for database. When I am installing sqlite3 via command npm install sqlite3 I'm getting following error in the console. How ...
jonybekov's user avatar
  • 284
18 votes
6 answers
20k views

Forever Node.JS Express 4

How do you run the Express 4 app with Forever? (or is there a new package?) I am running my Express 3 apps with Forever installed locally with the package manager. I use the command: forever -a ...
Eric Sheasby's user avatar
18 votes
1 answer
38k views

TypeScript: can only be default-imported using the 'esModuleInterop' flag

I've the following index.ts: import { User } from "./datatypes" import express from 'express'; console.log("hello world") This is my package.json: { "name": "...
domande stack's user avatar
15 votes
3 answers
74k views

Node.js - cannot find module

I'm using Node Boilerplate and it all worked fine until I decided create another project on top of it (in another dir). Now I have exactly the same code base (this project AS IS) in two different ...
user80805's user avatar
  • 6,338
15 votes
5 answers
22k views

"npm ERR! errno 3221225477" Error in Node when making a query using oracledb

This is the error itself in the command line: npm ERR! code ELIFECYCLE npm ERR! errno 3221225477 npm ERR! [email protected] start: `node ./bin/www` npm ERR! Exit status 3221225477 npm ERR! npm ERR! ...
Levi Blodgett's user avatar
15 votes
2 answers
102k views

Why am I getting "Error socket hang up" response?

I tried to scrape a website. And I am using the library https://github.com/request/request, but I get this error: Error: socket hang up at createHangUpError (http.js:1476:15) at Socket....
Widada's user avatar
  • 595
13 votes
7 answers
20k views

Get esbuild to watch for changes, rebuild, and restart express server

I am trying to create a simple SSR powered project using express + react. To do this, I need to simultaneously watch frontend and backend scripts during development. The goal here is to use express ...
jaxramus's user avatar
  • 185
13 votes
7 answers
27k views

How to use nodemon with express js while npm start?

I want to use nodemon to automatically detect changes in my scripts in node.js project and restart when change detected. I have my project setup using express.js. How to use nodemon with express.js, ...
Abhishek Rathore's user avatar
13 votes
6 answers
6k views

Speed up deployment on Heroku [duplicate]

Heroku is great. But every time I deploy, Heroku seems to like to redownload and rebuild all the packages. With socket.io and mailparser this is taking around 3 minutes. Is there a way to speed up ...
Alexis's user avatar
  • 24.6k
13 votes
8 answers
45k views

npm install error - invalid package.json

I'm using this tutorial to understand implementing oauth2 in Node.js. This is my package.json: { "name": "application-name", "version": "0.0.1", "private": true, "scripts": { "start": "...
tldr's user avatar
  • 12.1k
13 votes
2 answers
53k views

Cannot use 'import.meta' outside a module

I have Node + Express + Babel + ES6 project with the following files: /package.json { "name": "test-backend", "version": "1.0.0", "description": ...
davidesp's user avatar
  • 3,923
12 votes
2 answers
43k views

Unexpected end of json input in Node.js

I have Json data which I receive it as post data in my node.js server. But the problem is, its not able to parse the string I sent.Here is my node.js server code. res.header("Access-Control-Allow-...
Akash Sateesh's user avatar
12 votes
2 answers
14k views

Winston: Attempt to write logs with no transports

I'm trying to set up an access log and an error log for my express server using Winston, but I seem to be doing something wrong. Here is my attempt at a config file: const winston = require('winston'...
user2771142's user avatar
11 votes
6 answers
15k views

Express doesn't work on ubuntu

I'm new with nodejs and trying to learn it. I have installed node framework express as global module by command: $ sudo npm install express -g This works correctly and I have it in /usr/lib/...
Andrii Tarykin's user avatar
11 votes
3 answers
20k views

Error: Could not locate the bindings file. Tried:

I ran into the following error while trying to run my electron app that contains my express app. Error: Could not locate the bindings file. Tried: I think the issue has to do with serialport module, ...
code_legend's user avatar
  • 3,245
11 votes
3 answers
20k views

I can't execute npm scripts in node why is this happening and how can i solve it

I need help fixing this problem I hope this can help and I tried running other commands in my terminal but it did not work 15.5.1 My version of node is the latest one. The code says three things ...
Shelton Louis's user avatar
10 votes
4 answers
20k views

NPM install express. Error: No compatible version found

My OS is Ubuntu 13.04, 32 bit. I am trying to install express with this command: $ npm install express And this is the error I get: npm http GET https://registry.npmjs.org/express npm http GET ...
Yami C. on MacOS's user avatar
10 votes
6 answers
51k views

localhost:3000 is not working in the browser [closed]

Backend: Express server, with npx create-express-api backend Frontend: Next.js, with npx create-react-app frontend I have implemented these command in my root folder and trying to run npm start xxx to ...
Hassan Mahmud's user avatar
10 votes
3 answers
22k views

node.js local modules :cannot find module error

I am trying to implement local modules in my application 1.Project root folder i have created folder named test with a file named index.js module.exports = { myFunction:function(){ ...
shamon shamsudeen's user avatar

1
2 3 4 5
19