Skip to content

Instantly share code, notes, and snippets.

@soundstep
Created Aug 15, 2017
Embed
What would you like to do?
test-pact-centos-vagrant
  1. get all the file of this gist in a folder
  2. download and install latest VirtualBox
  3. download and install latest Vagrant
  4. execute vagrant plugin install vagrant-vbguest
  5. execute vagrant up
  6. execute vagrant ssh
node -v
cd /app
npm install
node index.js

Ouptut:

[vagrant@ie11win7 app]$ node -v
v8.3.0
[vagrant@ie11win7 app]$ node index.js
module.js:491
    throw err;
    ^

Error: Cannot find module '@pact-foundation/pact-mock-service-linux-x64'
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/app/node_modules/@pact-foundation/pact-mock-service/index.js:7:18)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
var pact = require('@pact-foundation/pact-node');
console.log(pact);
cd;
curl -sL https://rpm.nodesource.com/setup_8.x | bash -;
yum install -y nodejs;
{
"name": "test-centos-pact",
"version": "1.0.0",
"description": "Test pact-node on centos 7",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@pact-foundation/pact-node": "4.12.0",
"grunt": "^1.0.1"
}
}
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.synced_folder ".", "/app"
config.vm.provision "shell",
path: "./node.sh"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment