Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install @pact-foundation/pact-node fails: Cannot find module 'rimraf' #82

Closed
argos83 opened this issue Mar 27, 2018 · 6 comments
Closed

Comments

@argos83
Copy link

argos83 commented Mar 27, 2018

Installation of pact-node fails since version 6.12.0 if rimraf has not been previously installed.

Tested with Node versions:

  • 4.8.7
  • 6.13.0
  • 8.9.4

On macOS High Sierra

Steps to reproduce:
Execute @pact-foundation/pact-node@6.12.2 on a clean node environment (i.e. no node modules installed)

$ npm install @pact-foundation/pact-node@6.12.2

....


gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  ACTION binding_gyp_ndtp_target_build_ndtp .
  TOUCH Release/obj.target/ndtp.stamp

> spawn-sync@1.0.15 postinstall /Users/********/node_modules/spawn-sync
> node postinstall


> caporal@0.10.0 postinstall /Users/********/node_modules/caporal
> (test -f ./node_modules/husky/bin/install.js && node ./node_modules/husky/bin/install.js) || exit 0


> @pact-foundation/pact-node@6.12.0 postinstall /Users/********/node_modules/@pact-foundation/pact-node
> node postinstall.js

module.js:540
    throw err;
    ^

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  ACTION binding_gyp_ndtp_target_build_ndtp .
  TOUCH Release/obj.target/ndtp.stamp

> spawn-sync@1.0.15 postinstall /Users/********/node_modules/spawn-sync
> node postinstall


> caporal@0.10.0 postinstall /Users/stello/git/contract-testing-cli/node_modules/caporal
> (test -f ./node_modules/husky/bin/install.js && node ./node_modules/husky/bin/install.js) || exit 0


> @pact-foundation/pact-node@6.12.2 postinstall /Users/********/node_modules/@pact-foundation/pact-node
> node postinstall.js

module.js:540
    throw err;
    ^

Error: Cannot find module 'rimraf'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/**********/node_modules/@pact-foundation/pact-node/standalone/install.js:10:14)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @pact-foundation/pact-node@6.12.2 postinstall: `node postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @pact-foundation/pact-node@6.12.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Seems that your installation scripts rely on rimraf which is only declared as a devDependency.

Workaround:

Execute npm install rimraf first.

@mboudreau
Copy link
Contributor

Crap, thought I had removed rimraf from the code. Fixing now.

@mboudreau
Copy link
Contributor

@argos83 Hey, sorry for the issue, new version is going out with the fix, 6.12.3. Cheers.

@BenSayers
Copy link

Thanks for fixing this so quickly @mboudreau!

@argos83
Copy link
Author

argos83 commented Mar 27, 2018

Thanks @mboudreau !

@mboudreau
Copy link
Contributor

@argos83 @BenSayers You're very welcome. It was my bad anyways :/

We already have a new version out with messaging support as well, 6.13.0. Cheers.

@bethesque
Copy link
Member

@BenSayers @argos83 the messaging code is just an alpha release. Don't jump the gun please @mboudreau!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants