question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
BenSayerscommented, Mar 27, 2018

Thanks for fixing this so quickly @mboudreau!

0reactions
bethesquecommented, Mar 29, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm install @pact-foundation/pact-node fails: Cannot find ...
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.
Read more >
SOLVED Error at the installation: cannot find module 'rimraf'
Hello there! I have an issue when I paste the command to install MM. It is an 'updated link to install MM' I...
Read more >
Gatsby Terminal Issue: Cannot find module 'rimraf'
I have attached the ERROR thrown below. I tried installing the missing modules and reinstalling the node and other extensions those didn't ...
Read more >
rimraf - npm
The UNIX command rm -rf for node. Install with npm install rimraf , or just drop rimraf.js somewhere. API. rimraf(f, [opts], callback).
Read more >
@pact-foundation/pact-node - npm package | Snyk
The npm package @pact-foundation/pact-node was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found