question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AWS Elastic Beanstalk Build Error: node-gyp requires that the user home directory is specified in either of the environmental variables HOME or USERPROFILE

See original GitHub issue

I have aws elastic beanstalk for node js application and I uploaded my node js app (zip file) to my instance but I saw this error in aws logs

The Error

node-gyp requires that the 'user'\''s' home directory is specified in either of the environmental variables HOME or 'USERPROFILE\n' at new Gyp '(/opt/elasticbeanstalk/node-install/node-v0.8.26-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js:54:11

Package.json

{
  "name": "testing-beanstalk",
  "description": "Testing Beanstalk",
  "author": "Bugan",
  "version": "1.0",
  "private": true,  
  "dependencies": {
    "express": "3.x",
    "socket.io": "0.9.6",
    "mysql": "2.0.1",
    "cron": "1.0.0",
  }
}

Any idea to solve this problem? How to set user home directory?

Thank you before

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Reactions:1
  • Comments:25 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
et304383commented, Sep 22, 2014

This is not a valid fix. The module should be able to be installed without needing bash variables set.

The NPM package should be installable without any shell variables set. Please fix this. Nothing should be installed assuming a HOME directory or need a home directory value set. Nothing should be writing to the user home directory if I’m installing NPM packages globally.

12reactions
whatchcommented, Nov 29, 2016

this is still an issue; deploying to aws elastic beanstalk, and running into this same issue. Also have issues with it on windows, docker, and on it goes. It literally has to be the largest point of failure in the node world. fix it for christ sakes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Beanstalk: Node.js deployment - node-gyp fails due to ...
This user lacks access to the /tmp/deployment/application/node_modules/ directory created by the npm install run and owned by root. (And it ...
Read more >
Elastic Beanstalk Amazon Linux 2 issue - Dmitry Semenov
Recently I run into a problem during initial deployment to one of our EB stacks (Build: Node.js 12 running on 64bit Amazon Linux...
Read more >
linux set system variable Code Example - Code Grepper
how to set path variable in linux temporarily? We can print the $SHELL environment variable to determine the current shell you are using....
Read more >
Error: node-gyp requires that the user's home directory is ...
Error : node-gyp requires that the user's home directory is specified in either of the environmental variables HOME or USERPROFILE.
Read more >
permission denied rb_sysopen opt/elasticbeanstalk deploy ...
AWS Elastic Beanstalk Build Error : node-gyp requires that the user home directory is specified in either of the environmental variables HOME or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found