Cannot use require('os') ERR_FILE_NOT_FOUND


#1

I have an angular2 application running in electron. I’ve been on this project for about 3 months or so, and am using electron because I need various OS functions, and saw the require(‘os’) built into node, and thought it’d be pretty useful.

Here’s my problem. This is throwing an error when electron starts.
function importOs(){
var os = require(“os”);
}

this is it basically. Nothing complicated.

GET file:///C:/Users/me/git/project/os
net::ERR_FILE_NOT_FOUND

That is the error. What am I doing wrong?


#2

Solved Please Delete