How to use built-in core Nodejs modules with Meteor@1.3.1 module system?

Hi, I am attempting to convert legacy code into the new module system and I am having difficulty importing node’s child_process into my module.

if it matters, I’ve only got 2 files mymodule.js and mymodule.test.js within the imports/startup/server/ folder.

I’ve tried:

const cp = require('child_process'); // {}
import {fork} from 'child_process'; // undefined
import child_process from 'child_process'; // undefined

I get this is the test reporter when I call cp.fork()

Error: TypeError: Object [object Object] has no method 'fork' [500]
    at Api.request (imports/startup/server/req/req.js:23:19)
    at Context.<anonymous> (imports/startup/server/req/req.test.js:9:26)
    at run (packages/practicalmeteor:mocha/meteor/src/setup/SetupRunnables.js:113:18)

I get this in the console

Unable to resolve some modules:
"child_request" in imports/startup/server/req/req.test.js

If you notice problems related to these missing modules, consider running:

meteor npm install --save child_request     

I am currently using 1.3.1 and will not be upgrading until we can sort out the bug in huttonr:boostrap’s issue

Thanks for your help!

All 3 should work fine… from your error in the console, it looks like you were trying to import "child_request" instead of child_process ?