So, I'm trying to use node modules with JavaScript and for that, I need to load the modules with "require", so I installed Require.js like so:
npm i requirejs
This is my code:
var ecurve = require('ecurve') ;
var BigInteger = require('bigi')
var AES = require("crypto-js/aes");
var SHA256 = require("crypto-js/sha256");
var CryptoJS = require("crypto-js");
However, I always get this error:
require is not defined
I've tried Browserify and solved the problem but I need another solution without Browserify. Any ideas?
node /my/file.js?requirejswhen running a node application.requireis built into node, so it sounds like you are not running the file properly.