nodeunit icon indicating copy to clipboard operation
nodeunit copied to clipboard

require('nodeunit') fails after npm install?

Open mrkurt opened this issue 14 years ago • 2 comments

I don't know that this is a nodeunit bug, so much, but it has me stumped.

Using node 0.2.6, I installed nodeunit via npm. When I require nodeunit, though, it blows up:

crapple:node-v0.2.6 kurt$ node > require('nodeunit') Error: Cannot find module 'nodeunit' at loadModule (node.js:275:15) at require (node.js:411:14) at cwdRequire (repl:29:10) at [object Context]:1:1 at Interface. (repl:96:19) at Interface.emit (events:31:17) at Interface._ttyWrite (readline:309:12) at Interface.write (readline:147:30) at Stream. (repl:79:9) at Stream.emit (events:31:17)

I have node installed into ~/opt/, all my other npm packages are working fine. Can someone point me in the right direction?

mrkurt avatar Feb 01 '11 20:02 mrkurt

How are you installing nodeunit, globally or locally?

mreinstein avatar Mar 30 '13 00:03 mreinstein

So I don't see a fix or work around. I am using Windows, and installed via 'npm install nodeunit -g'. Receiving the following stack trace:

Error: Cannot find module 'nodeunit' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (C:\Users\David\IdeaProjects\RazorJS\testing\dbtesting.js:6:12) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

IAbstract avatar Jan 02 '15 20:01 IAbstract