SailsJs Invalid module error - node.js

After I installed lodash or async plug-ins,
Console shows those error messages when I launch sails.js.
but I don't know what cause those error messages.
I need to solve this problem. please anyone help me.
error: A hook (`userconfig`) failed to load!
error: Error: Invalid module:[object Object]
at /Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:83:15
at forOwn (/Users/johndo/github/sails/testProject/node_modules/lodash/dist/lodash.js:2105:15)
at Function.forEach (/Users/johndo/github/sails/testProject/node_modules/lodash/dist/lodash.js:3302:9)
at buildDictionary (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:74:4)
at Function.module.exports.aggregate (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:190:9)
at Array.loadOtherConfigFiles [as 0] (/Users/johndo/github/sails/testProject/node_modules/sails/lib/hooks/moduleloader/index.js:164:27)
at /Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:459:38
at Array.forEach (native)
at _each (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:32:24)
at Object.async.auto (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:430:9) [Error: Invalid module:[object Object]]
error: Error: Invalid module:[object Object]
at /Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:83:15
at forOwn (/Users/johndo/github/sails/testProject/node_modules/lodash/dist/lodash.js:2105:15)
at Function.forEach (/Users/johndo/github/sails/testProject/node_modules/lodash/dist/lodash.js:3302:9)
at buildDictionary (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:74:4)
at Function.module.exports.aggregate (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/sails-build-dictionary/index.js:190:9)
at Array.loadOtherConfigFiles [as 0] (/Users/johndo/github/sails/testProject/node_modules/sails/lib/hooks/moduleloader/index.js:164:27)
at /Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:459:38
at Array.forEach (native)
at _each (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:32:24)
at Object.async.auto (/Users/johndo/github/sails/testProject/node_modules/sails/node_modules/async/lib/async.js:430:9) [Error: Invalid module:[object Object]]

It looks like it's experiencing an error while parsing your configuration files. Try rolling back your changes.
Also, lodash and async come as globals in sails, so you don't need to install them. Just go to config/globals and uncomment _(lodash). That might fix your problem, as maybe sails is having a conflict between its installed version and yours.

Related

bundling failed: Error: Unable to resolve module in React native UI Kitten

bundling failed: Error: Unable to resolve module ./style/styleConsumer.component from node_modules\#ui-kitten\components\theme\index.js:
Getting this error after upgrading Ui Kitten from 4.3.1 to 4.4.0
The detailed log is:
error: bundling failed: Error: Unable to resolve module `./style/styleConsumer.component` from `node_modules\#ui-kitten\components\theme\index.js`:
None of these files exist: * node_modules\#ui-kitten\components\theme\style\styleConsumer.component(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
* node_modules\#ui-kitten\components\theme\style\styleConsumer.component\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
at ModuleResolver.resolveDependency (d:\HotelAppNoExpo\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:163:15)
at ResolutionRequest.resolveDependency (d:\HotelAppNoExpo\node_modules\metro\src\node-haste\DependencyGraph\ResolutionRequest.js:52:18)
at DependencyGraph.resolveDependency (d:\HotelAppNoExpo\node_modules\metro\src\node-haste\DependencyGraph.js:282:16)
at Object.resolve (d:\HotelAppNoExpo\node_modules\metro\src\lib\transformHelpers.js:267:42)
at d:\HotelAppNoExpo\node_modules\metro\src\DeltaBundler\traverseDependencies.js:426:31
at Array.map (<anonymous>)
at resolveDependencies (d:\HotelAppNoExpo\node_modules\metro\src\DeltaBundler\traverseDependencies.js:423:18)
at d:\HotelAppNoExpo\node_modules\metro\src\DeltaBundler\traverseDependencies.js:275:33
at Generator.next (<anonymous>)
at asyncGeneratorStep (d:\HotelAppNoExpo\node_modules\metro\src\DeltaBundler\traverseDependencies.js:87:24)
Screenshot
How to fix this?
You should start your app with clearing cache

Getting error cannot read property 'stripe' of undefined (Meteor)

I an new to Meteor framework and trying to setup Meteor project in my local system and its showing below error. I tried googling but didnt find the solution.
/Users/progeshsubba/.meteor/packages/meteor-tool/.1.4.4_1.zu6xaw.bnn3++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
throw(ex);
^
TypeError: Cannot read property 'stripe' of undefined
at meteorInstall.server.methods.plans.methods.js (server/methods/plans/methods.js:3:32)
at fileEvaluate (packages/modules-runtime.js:197:9)
at require (packages/modules-runtime.js:120:16)
at /Users/progeshsubba/Desktop/surveyand/.meteor/local/build/programs/server/app/app.js:2672:1
at /Users/progeshsubba/Desktop/surveyand/.meteor/local/build/programs/server/boot.js:303:34
at Array.forEach (native)
at Function._.each._.forEach (/Users/progeshsubba/.meteor/packages/meteor-tool/.1.4.4_1.zu6xaw.bnn3++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
at /Users/progeshsubba/Desktop/surveyand/.meteor/local/build/programs/server/boot.js:128:5
at /Users/progeshsubba/Desktop/surveyand/.meteor/local/build/programs/server/boot.js:352:5
at Function.run (/Users/progeshsubba/Desktop/surveyand/.meteor/local/build/programs/server/profile.js:510:12)
at /Users/progeshsubba/Desktop/surveyand/.meteor/local/build/programs/server/boot.js:351:11

Module build failed: TypeError: loader.charAt is not a function

I'm trying to run the npm run dev command, but I'm getting this message:
ERROR Failed to compile with 2 errors 21:31:43
Module build failed: TypeError: loader.charAt is not a function
at ensureBang (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:180:16)
at getLoaderString (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:145:18)
at getRequireString (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:80:7)
at getRequire (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:71:7)
at D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:205:11
at Array.forEach (<anonymous>)
at Object.module.exports (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:198:18)
Module build failed: TypeError: loader.charAt is not a function
at ensureBang (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:180:16)
at getLoaderString (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:145:18)
at getRequireString (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:80:7)
at getRequire (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:71:7)
at D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:205:11
at Array.forEach (<anonymous>)
at Object.module.exports (D:\iagof\Source\Repos\todo-list\node_modules\vue-loader\lib\loader.js:198:18)
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
This problem appeared when I tried to reinstall all the modules. Anything, my project is on Github. Follow the repository link https://github.com/iagofrota/todo-list.

phantomjs-pdf not work

I'm using phantomjs-pdf in my sailsjs app. This code working fine in my local machine(ubuntu 14.0). but server machine(ubuntu 12.0) cause error, like below
internal/child_process.js:274
var err = this._handle.spawn(options);
^
TypeError: Bad argument
at TypeError (native)
at ChildProcess.spawn (internal/child_process.js:274:26)
at exports.spawn (child_process.js:339:9)
at Object.exports.execFile (child_process.js:141:15)
at /var/www/test/node_modules/phantomjs-pdf/lib/phantomjs-pdf.js:83:16
at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:721:13
at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:52:16
at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:269:32
at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:44:16
at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:718:17
at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:167:37
at async.series.paperFormat (/var/www/test/node_modules/phantomjs-pdf/lib/phantomjs-pdf.js:51:70)
at /var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:713:13
at Immediate.iterate [as _onImmediate] (/var/www/test/node_modules/phantomjs-pdf/node_modules/async/lib/async.js:262:13)
at processImmediate [as _immediateCallback] (timers.js:371:17)
This is my error. Any one tell me what is the problem. help me.
Uninstall all NPM packages and then reinstall NPM packages.

Requirejs with nodejs doesn't tell me the line number of the error, just the error

Requirejs with nodejs doesn't tell me the line number of the error, just the error
For example the result is: Error: Evaluating ccc.js as module "ccc" failed with error: SyntaxError: Unexpected token ,
And then the stack:
at Function.req.load (D:\web\pc\node_modules\requirejs\bin\r.js:2470:23)
at Object.context.load (D:\web\pc\node_modules\requirejs\bin\r.js:1858:21)
at Object.Module.load (D:\web\pc\node_modules\requirejs\bin\r.js:1059:29)
at Object.Module.fetch (D:\web\pc\node_modules\requirejs\bin\r.js:1049:66)
at Object.Module.check (D:\web\pc\node_modules\requirejs\bin\r.js:1079:26)
at Object.Module.enable (D:\web\pc\node_modules\requirejs\bin\r.js:1376:22)
at Object.context.enable (D:\web\pc\node_modules\requirejs\bin\r.js:1730:39)
at Object.<anonymous> (D:\web\pc\node_modules\requirejs\bin\r.js:1361:33)
at g (D:\web\pc\node_modules\requirejs\bin\r.js:363:23)
at each (D:\web\pc\node_modules\requirejs\bin\r.js:291:31)
at Object.Module.enable (D:\web\pc\node_modules\requirejs\bin\r.js:1323:17)
at Object.Module.init (D:\web\pc\node_modules\requirejs\bin\r.js:1013:26)
at callGetModule (D:\web\pc\node_modules\requirejs\bin\r.js:1403:63)
at Object.context.completeLoad (D:\web\pc\node_modules\requirejs\bin\r.js:1763:21)
at Function.req.load (D:\web\pc\node_modules\requirejs\bin\r.js:2510:17)
at Object.context.load (D:\web\pc\node_modules\requirejs\bin\r.js:1858:21)
at Object.Module.load (D:\web\pc\node_modules\requirejs\bin\r.js:1059:29)
at Object.Module.fetch (D:\web\pc\node_modules\requirejs\bin\r.js:1049:66)
at Object.Module.check (D:\web\pc\node_modules\requirejs\bin\r.js:1079:26)
at Object.Module.enable (D:\web\pc\node_modules\requirejs\bin\r.js:1376:22)
at Object.context.enable (D:\web\pc\node_modules\requirejs\bin\r.js:1730:39)
at Object.<anonymous> (D:\web\pc\node_modules\requirejs\bin\r.js:1361:33)
at g (D:\web\pc\node_modules\requirejs\bin\r.js:363:23)
at each (D:\web\pc\node_modules\requirejs\bin\r.js:291:31)
at Object.Module.enable (D:\web\pc\node_modules\requirejs\bin\r.js:1323:17)
at Object.Module.init (D:\web\pc\node_modules\requirejs\bin\r.js:1013:26)
at Object.context.makeRequire.mixin.isBrowser [as _onTimeout] (D:\web\pc\node_modules\requirejs\bin\r.js:1646:36)
at Timer.list.ontimeout (timers.js:101:19)
And where the error is? I know the file but what line?
thanks for help
It's not a problem with requirejs and was fixed in nodejs version 0.12.
Unfortunately, there are not enough hooks into vm.runInThisContext in
older node versions to get to the information.
More info you can find here
So, nodejs v.0.10 doesn't want to show additional info about problem. But if you want - you can install newest version of nodejs and gets more info about syntax errors in "required" files.
By the way, with Docker it's pretty easy - all you need just pull repo from node:0.12.

Resources