当我启动我的 JS 文件时,出现以下错误:
Charon:modules Modius$ node testfile.js
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: define is not defined
at Object.<anonymous> (/Applications/MAMP/htdocs/spacebattles/server/modules/testfile.js:11:1)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
Charon:modules Modius$
这里是js文件
define(['./db_user'], function (db_user) {
var db_user = document.createElement("db_user.js");
var tranfer = {
login: "test" ,
email: "holishitumsonst.com",
password: "123nu"
};
db_user.insert(transfer);
});
感谢帮助