Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having a problem running npm install when using Puppet to set up my application.

I'm using Puppet to set up a node.js application that we will be using live in a few weeks. This application has sqlite3 as a dependency. The problem I run into is when running 'npm install" the sqlite3 dependency has to be compiled from source to run properly. However the correct command:

npm install --build-from-source=sqlite3

Will not run properly using the exec command in Puppet. I have my Puppet code below:

exec { 'npm install --build-from-source=sqlite3' :
    cwd => '/var/video_server',
    user => 'root',
    path => '/usr/local/node/node-default/bin'

How do I get either the sqlite3 to properly compile using Puppet? I do not want to have to run npm install manually on every server I set this application up on.

share|improve this question

It seems your PATH is not sufficiently configured.
When you build an module from source npm will have to run multiple commands which have to be on your PATH.
So please try this:

exec { 'npm install --build-from-source=sqlite3' :
    cwd => '/var/video_server',
    user => 'root',
    path => ['/usr/local/node/node-default/bin', '/bin', '/usr/bin']

hope this helps you out.

To verify yourself it works you could try running as root in /var/video_server :

PATH=/usr/local/node/node-default/bin:/bin:/usr/bin npm install --build-from-source=sqlite3
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.