node.js

ENOSPC error on AWS Lambda

南笙酒味 提交于 2021-02-10 13:24:38
问题 Sorry for this loaded question. I. TL;DR: The /tmp directory on AWS Lambda keeps filling up when it shouldn't and gives me ENOSPC error on subsequent request. II. The TL version: I have a microservice built with Node JS (0.10x) on AWS Lambda that does 2 things: Given a list of urls, it goes to relevant sources (S3, Cloudfront, thumbor, etc.) and download the physical files into the /tmp directory After downloading all of these files, it will compress them into a tar ball and upload to S3.

`Extensions` field not shown in apollo graphql response data

我们两清 提交于 2021-02-10 13:20:30
问题 Here is a reproducible example. Run app.js and navigate the playground at http://localhost:4000/graphql You can run queries like: query RecipeQuery{ recipe(title:"Recipe 2"){ description } } Problem: I need debugging information from the extensions field in the response data. I'm talking about this extensions field: "data":{....}, "extensions": { "tracing": {} "cacheControl":{} } But in reality, I'm only getting the data field: "data":{....} I have already enabled tracing and cacheControl in

Node app segfault on Heroku: std::bad_alloc and exit code 134

孤者浪人 提交于 2021-02-10 13:19:07
问题 I am having difficulty understanding this heroku stack trace. My app has been running very well both locally and in Heroku for a few years now. Yet I am suddenly plagued by immediate crashes on Heroku. Here is the stack trace: 2019-05-14T14:05:14.947049+00:00 heroku[web.1]: Starting process with command `yarn run server` 2019-05-14T14:05:17.599376+00:00 app[web.1]: yarn run v1.16.0 2019-05-14T14:05:17.680344+00:00 app[web.1]: $ babel-node src/server.js 2019-05-14T14:05:20.674637+00:00 app[web

How to send form data to server

谁说我不能喝 提交于 2021-02-10 13:17:27
问题 I want to build a small website. I have backend almost done but i can't find how can i send form data to server. Here is my attempt and i want to send the data to localhost running at port 3000 for example: jQuery('#signUp-Form').on('submit',function(e){ e.preventDefault(); console.log('Sending data'); var name = jQuery('[name = username]').val(); // socket.emit('sign-up',{ // username: jQuery('[name = username]').val(), // password: jQuery('[name = password]').val() // }); }); I can do with

I am getting npm error while installing react navigation. Do anyone know about this issue?

浪子不回头ぞ 提交于 2021-02-10 12:50:51
问题 ERR! code 1 npm ERR! Command failed: /usr/bin/git clone -q git://github.com/react-navigation/react-native-tab-view.git /Users/nakul/.npm/_cacache/tmp/git-clone-818101c2 npm ERR! /Users/nakul/.npm/_cacache/tmp/git-clone-818101c2/.git: Permission denied npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! /Users/nakul/.npm/_logs/2018-04-14T10_46_28_136Z-debug.log 回答1: Try chmod -R 777 ~/.npm then reinstall. Or rm -rf ~/.npm and reinstall. ~/.npm is a temp directory and can be

I am getting npm error while installing react navigation. Do anyone know about this issue?

删除回忆录丶 提交于 2021-02-10 12:49:27
问题 ERR! code 1 npm ERR! Command failed: /usr/bin/git clone -q git://github.com/react-navigation/react-native-tab-view.git /Users/nakul/.npm/_cacache/tmp/git-clone-818101c2 npm ERR! /Users/nakul/.npm/_cacache/tmp/git-clone-818101c2/.git: Permission denied npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! /Users/nakul/.npm/_logs/2018-04-14T10_46_28_136Z-debug.log 回答1: Try chmod -R 777 ~/.npm then reinstall. Or rm -rf ~/.npm and reinstall. ~/.npm is a temp directory and can be

I am getting npm error while installing react navigation. Do anyone know about this issue?

北战南征 提交于 2021-02-10 12:48:53
问题 ERR! code 1 npm ERR! Command failed: /usr/bin/git clone -q git://github.com/react-navigation/react-native-tab-view.git /Users/nakul/.npm/_cacache/tmp/git-clone-818101c2 npm ERR! /Users/nakul/.npm/_cacache/tmp/git-clone-818101c2/.git: Permission denied npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! /Users/nakul/.npm/_logs/2018-04-14T10_46_28_136Z-debug.log 回答1: Try chmod -R 777 ~/.npm then reinstall. Or rm -rf ~/.npm and reinstall. ~/.npm is a temp directory and can be

pool.request is not a function

让人想犯罪 __ 提交于 2021-02-10 12:41:58
问题 I would like to setup my prepared statements with the mssql module. I created a query file for all user related requests. const db = require('../databaseManager.js'); module.exports = { getUserByName: async username => db(async pool => await pool.request() .input('username', dataTypes.VarChar, username) .query(`SELECT * FROM person WHERE username = @username;`)) }; This approach allows me to require this query file and access the database by executing the query that is needed const

pool.request is not a function

谁说胖子不能爱 提交于 2021-02-10 12:41:42
问题 I would like to setup my prepared statements with the mssql module. I created a query file for all user related requests. const db = require('../databaseManager.js'); module.exports = { getUserByName: async username => db(async pool => await pool.request() .input('username', dataTypes.VarChar, username) .query(`SELECT * FROM person WHERE username = @username;`)) }; This approach allows me to require this query file and access the database by executing the query that is needed const

pool.request is not a function

若如初见. 提交于 2021-02-10 12:41:04
问题 I would like to setup my prepared statements with the mssql module. I created a query file for all user related requests. const db = require('../databaseManager.js'); module.exports = { getUserByName: async username => db(async pool => await pool.request() .input('username', dataTypes.VarChar, username) .query(`SELECT * FROM person WHERE username = @username;`)) }; This approach allows me to require this query file and access the database by executing the query that is needed const