Jonathan Lameira
Jonathan Lameira

Reputation: 1

How can I resolve error in project MEAN?

I have problem with running grunt

 "Cannot find module './api" 

line error routes.js --->image structure project app.use('/api/things', require('./api\thing'));

but this module in my project. i create project with yo angular-fullstack.

I do not understand what the problem is. any people help me? someone to help me in this?

Running "mochaTest:unit" (mochaTest) task
>> Mocha exploded!
>> Error: Cannot find module './api     hing'
>>     at Function.Module._resolveFilename (module.js:336:15)
>>     at Function.Module._load (module.js:278:25)
>>     at Module.require (module.js:365:17)
>>     at require (module.js:384:17)
>>     at module.exports (C:/Users/Jonathan/Documents/bdsmeanshop/server/routes.js:13:26)
>>     at Object.<anonymous> (C:/Users/Jonathan/Documents/bdsmeanshop/server/app.js:33:20)
>>     at Module._compile (module.js:460:26)
>>     at normalLoader (C:\Users\Jonathan\Documents\bdsmeanshop\node_modules\babel-core\lib\api\register\node.js:199:5)
>>     at Object.require.extensions.(anonymous function) [as .js] (C:\Users\Jonathan\Documents\bdsmeanshop\node_modules\babel-core\lib\api\register\node.js:216:7)
>>     at Module.load (module.js:355:32)
>>     at Function.Module._load (module.js:310:12)
>>     at Module.require (module.js:365:17)
>>     at require (module.js:384:17)
>>     at Object.<anonymous> (C:/Users/Jonathan/Documents/bdsmeanshop/server/api/user/user.model.spec.js:3:11)
>>     at Module._compile (module.js:460:26)
>>     at normalLoader (C:\Users\Jonathan\Documents\bdsmeanshop\node_modules\babel-core\lib\api\register\node.js:199:5)
>>     at Object.require.extensions.(anonymous function) [as .js] (C:\Users\Jonathan\Documents\bdsmeanshop\node_modules\babel-core\lib\api\register\node.js:216:7)
>>     at Module.load (module.js:355:32)
>>     at Function.Module._load (module.js:310:12)
>>     at Module.require (module.js:365:17)
>>     at require (module.js:384:17)
>>     at C:\Users\Jonathan\Documents\bdsmeanshop\node_modules\mocha\lib\mocha.js:220:27
Warning: Task "mochaTest:unit" failed. Use --force to continue.

Aborted due to warnings.

Upvotes: 0

Views: 134

Answers (1)

user3366016
user3366016

Reputation: 1312

Moving comment as answer.

Arent you escaping the t in thing? app.use('/api/things', require('./api\thing')); try ./api/thing. The error says cant find './api hing'

Upvotes: 2

Related Questions