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.

I work with nvm to load node and npm.

to use these binaries in the post-deploy hook (with the nvm user of course), the PATH seemed not to be set.

command not found: npm

a quick fix was for me to add the bin dir to the PATH, as:

 "post-deploy" : "export PATH=$PATH:/home/raf/.nvm/v0.10.34/bin/ && npm rebuild && pm2 startOrRestart ecosystem.json --env dev",
      env  : {
        NODE_ENV: "dev"
      }

This worked, but I doubt this is the recommended way. Anyone a suggestion how this fix can be avoided?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
ginuscommented, Apr 16, 2017

@josser @vinaynb @Unitech I exec command below:

pm2 deploy staging exec "echo $NVM_DIR"
--> Deploying to staging environment
--> on host 121.196.207.137
/Users/art/.nvm
--> Success

it is the local value not but server value of $NVM_DIR, see that, if I use ssh login server side and exec “echo $NVM_DIR”

➜  ~ echo $NVM_DIR
/root/.nvm

so if any solution ?

2reactions
Raffikicommented, Dec 31, 2014

indeed, non-interactive shells are returned early with

case $- in
    *i*) ;;
      *) return;;
esac

thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node Version Manager install - nvm command not found
This happens because when installing NVM it adds code to ~/.bashrc , as my terminal Deepin Terminal uses zsh and not bash it...
Read more >
nvm: command not found error [Solved] | bobbyhadz
To solve the error "nvm: command not found", run the curl or wget commands to download and run the installation script, close your...
Read more >
Node Version Manager – nvm Install Guide - freeCodeCamp
How to Install NVM on Windows · 1. Click on "Download Now" · 2. Install the .exe file of the latest release ·...
Read more >
How to fix the nvm command not found Error - Reactgo
In this tutorial, we will learn how to solve the nvm command not found error. When you install an nvm (node version manager)...
Read more >
nvm command not found :( - DEV Community ‍ ‍
Node Version Manager (NVM) is a tool used to manage multiple active Node.js versions. If you're trying to install NVM(Node Version Manager) in ......
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 Reddit Thread

No results found

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