Skip to content

Vagrant: add NodeSource package repos

webpack-dev-server wants Node >= 4.7, but the version of Node.js shipped with Ubuntu Trusty is much older (0.10).

With the Ubuntu native Node.js, gdk install fails:

12:29:50 webpack.1               | 
12:29:50 webpack.1               | > @ dev-server /vagrant/gitlab
12:29:50 webpack.1               | > webpack-dev-server --config config/webpack.config.js
12:29:50 webpack.1               | 
12:29:50 webpack.1               | 
12:29:50 webpack.1               | /vagrant/gitlab/node_modules/webpack-dev-server/bin/webpack-dev-server.js:4
12:29:50 webpack.1               | const path = require("path");
12:29:50 webpack.1               | ^^^^^
12:29:50 webpack.1               | SyntaxError: Use of const in strict mode.
12:29:50 webpack.1               |     at Module._compile (module.js:439:25)
12:29:50 webpack.1               |     at Object.Module._extensions..js (module.js:474:10)
12:29:50 webpack.1               |     at Module.load (module.js:356:32)
12:29:50 webpack.1               |     at Function.Module._load (module.js:312:12)
12:29:50 webpack.1               |     at Function.Module.runMain (module.js:497:10)
12:29:50 webpack.1               |     at startup (node.js:119:16)
12:29:50 webpack.1               |     at node.js:902:3
12:29:50 webpack.1               | npm ERR! weird error 8
12:29:50 webpack.1               | npm WARN This failure might be due to the use of legacy binary "node"
12:29:50 webpack.1               | npm WARN For further explanations, please read
12:29:50 webpack.1               | /usr/share/doc/nodejs/README.Debian

Install the NodeSource package repos during the early shell provisioner to get Node.js 6.x.

Merge request reports