Closed rassiel closed 8 years ago
There is an issue in:
server/config/environment/index.js
specificly here:
// Export the config object based on the NODE_ENV
// ==============================================
module.exports = _.merge(
all,
require('./shared'),
require('./' + process.env.NODE_ENV + '.js') : {});
If the NODE_ENV is undefined. It still tries to read it and it throws that error. I was able to fix it doing this:
// Export the config object based on the NODE_ENV
// ==============================================
var processRequire = process.env.NODE_ENV != undefined ? require('./' + process.env.NODE_ENV + '.js') : {};
module.exports = _.merge(
all,
require('./shared'),
processRequire);
oh @Nykho thanks a lot!! Now I'm getting another error... I've couldn't found the cause so far... This is the error:
[4mRunning "mochaTest:unit" (mochaTest) task[24m
[31m [39mMocha exploded!
[31m [39mTypeError: require(...) is not a function[31m
[39m at Object.<anonymous> (app.js:30:29)[31m
[39m at Module._compile (module.js:397:26)[31m
[39m at loader (C:\git\automa\node_modules\babel-register\lib\node.js:131:5)[31m
[39m at Object.require.extensions.(anonymous function) [as .js] (C:\git\automa\node_modules\babel-register\lib\node.js:141:7)[31m
[39m at Module.load (module.js:343:32)[31m
[39m at Function.Module._load (module.js:300:12)[31m
[39m at Module.require (module.js:353:17)[31m
[39m at require (internal/module.js:12:17)[31m
[39m at Object.<anonymous> (index.js:12:28)[31m
[39m at Module._compile (module.js:397:26)[31m
[39m at loader (C:\git\automa\node_modules\babel-register\lib\node.js:131:5)[31m
[39m at Object.require.extensions.(anonymous function) [as .js] (C:\git\automa\node_modules\babel-register\lib\node.js:141:7)[31m
[39m at Module.load (module.js:343:32)[31m
[39m at Function.Module._load (module.js:300:12)[31m
[39m at Module.require (module.js:353:17)[31m
[39m at require (internal/module.js:12:17)[31m
[39m at Object.<anonymous> (user.model.spec.js:1:14)[31m
[39m at Module._compile (module.js:397:26)[31m
[39m at loader (C:\git\automa\node_modules\babel-register\lib\node.js:131:5)[31m
[39m at Object.require.extensions.(anonymous function) [as .js] (C:\git\automa\node_modules\babel-register\lib\node.js:141:7)[31m
[39m at Module.load (module.js:343:32)[31m
[39m at Function.Module._load (module.js:300:12)
[33mWarning: Task "mochaTest:unit" failed. Use --force to continue.[39m
[31mAborted due to warnings.[39m
Execution Time (2016-01-25 17:21:28 UTC)
loading tasks 238ms █████ 13%
loading grunt-mocha-test 46ms █ 3%
mochaTest:unit 1.5s ███████████████████████████████ 84%
Total 1.8s
I'm getting this error too. Any fix for this?
How about upgrading to Babel 6.0? I tried doing that myself but I haven't been able to successfully run the unit tests. please check my repo if you like: https://github.com/rassiel/automa I added:
.babelrc
Gruntfile.js
modified therequire: ['babel-register','mocha.conf.js'],
inmochaTest
taskmocha.conf.js
removedrequire('babel-core/register');
but still getting error when doinggrunt mochaTest:unit