I am attempting to install node.js, npm and Grunt.js in an Ubuntu Trusty 64bit Vagrant environment and running into some issues. Here is my puppet manifest:
init.pp --class grunt::install {
exec { 'apt_update':
command => 'apt-get update',
path => '/usr/bin'
}
package { [
'curl',
'python-software-properties',
'ruby1.9.3'
]:
ensure => present,
require => Exec['apt_update']
}
# Get node
exec { 'add-node-repo':
command => '/usr/bin/add-apt-repository ppa:chris-lea/node.js && /usr/bin/apt-get update',
require => Package['python-software-properties']
}
package { 'nodejs':
ensure => latest,
require => [Exec['apt_update'], Exec['add-node-repo']]
}
# Install npm
exec { 'npm':
command => '/usr/bin/curl -L https://npmjs.org/install.sh | /bin/sh',
require => [Package['nodejs'], Package['curl']],
environment => 'clean=yes'
}
# Create symlink to stop node-modules folder breaking
exec { 'node-modules-symlink':
command => '/bin/rm -rfv /usr/local/node_modules && /bin/rm -rfv /vagrant/node_modules && /bin/mkdir /usr/local/node_modules && /bin/ln -sf /usr/local/node_modules /vagrant/node_modules ',
}
# Copy Grunt config files over for the vagrant setup.
file { '/vagrant/package.json':
source => 'puppet:///modules/grunt/package.json'
}
file { '/vagrant/Gruntfile.js':
source => 'puppet:///modules/grunt/Gruntfile.js'
}
# Finally install grunt
exec { 'install-grunt':
command => '/usr/bin/npm install -g grunt-cli',
require => Exec['npm']
}
# Install grunt task runner in directory
exec { 'install-grunt-task-runner':
command => '/usr/bin/npm install grunt --save-dev',
cwd => '/vagrant/',
require => Exec['install-grunt']
}
exec { 'install-project-dependencies':
command => '/usr/bin/npm install --save-dev',
require => [Exec['install-grunt-task-runner'], Exec['node-modules-symlink']],
cwd => '/vagrant/'
}
}
...and here is the console error log I am getting:
Stderr from the command:
stdin: is not a tty
Error: /usr/bin/npm install grunt --save-dev returned 1 instead of one of [0]
Error: /Stage[main]/Grunt::Install/Exec[install-grunt-task-runner]/returns: change from notrun to 0 failed: /usr/bin/npm install grunt --save-dev returned 1 instead of one of [0]
Warning: /Stage[main]/Grunt::Install/Exec[install-project-dependencies]: Skipping because of failed dependencies
Thanks in advance for any help/suggestions! :D