PhatomJS: How can I use(require) an npm module in phatom js? - node.js

i'm trying to require() and use this logging module (it has some dependencies also) in phatomJS but it fails and prints this error:
C:\node\scrap>phantomjs app.js
ReferenceError: Can't find variable: process
phantomjs://platform/index.js:3
ReferenceError: Can't find variable: process
phantomjs://platform/index.js:9
TypeError: undefined is not an object (evaluating 'chalk.bold.red')
phantomjs://platform/index.js:29
TypeError: undefined is not a constructor (evaluating 'log.info('All settings loaded, start with exe
cution')')
phantomjs://code/app.js:16 in global code
I don't know why or what's wrong ? what am I missing ?

Related

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.

Cannot run Angular app from browser

I got the following error messages when accessing my app from the browser with :
54.255.239.55:3443/home/app/index.html
GET https://54.255.239.55:3443/home/bower_components/angular/angular.min.js net::ERR_CONNECTION_RESET
GET https://54.255.239.55:3443/home/bower_components/angular-ui-router/release/angular-ui-router.min.js net::ERR_CONNECTION_RESET
GET https://54.255.239.55:3443/home/bower_components/font-awesome/css/font-awesome.min.css net::ERR_CONNECTION_RESET
GET https://54.255.239.55:3443/home/app/styles/bootstrap-social.css net::ERR_CONNECTION_RESET
GET https://54.255.239.55:3443/home/bower_components/bootstrap/dist/css/bootstrap-them.min.css net::ERR_CONNECTION_RESET
Uncaught TypeError: Cannot read property '$$minErr' of undefined
at angular-resource.min.js:6
at angular-resource.min.js:14
Uncaught TypeError: Cannot read property 'module' of undefined
at angular-resource.min.js:6
at angular-resource.min.js:14
Uncaught TypeError: Cannot read property 'module' of undefined
at ngDialog.min.js:2
at ngDialog.min.js:2
at ngDialog.min.js:2
Uncaught ReferenceError: angular is not defined
at app.js:3
Uncaught ReferenceError: angular is not defined
at controllers.js:3
Uncaught ReferenceError: angular is not defined
at services.js:3
My project file structure is:
app
-images
-scripts
-styles
-views
bower_components
-css
-bootstrap.css
-bootstrap.css.map
-bootstrap.min.css
-bootstrap.min.css.map
-bootstrap-theme.css
-bootstrap-theme.css.map
-bootstrap-theme.min.css
-bootstrap-theme.min.css.map
-fonts
-js
-bootstrap.js
-bootstrap.min.js
-npm.js
-node_modules
I need help please.

Uncaught NoMethodError: undefined method `render' for #<Element [<div

I want to mount my component use this code in Opal file:
Element['#wizard_param_grid_editor'].render do
ZGrid(rows: #work_spaces)
End
I got the Error
Uncaught NoMethodError: undefined method render' for #]>
change
require 'opal-jquery'
before
require 'reactive-ruby'
fix this

Loading "connect_proxy.js" tasks...ERROR >> TypeError: Cannot read property 'prototype' of undefined

I'm trying to run a http server using grunt. However, when I type grunt serve in the appropriate directory, I'm presented with the following errors:
Loading "connect_proxy.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined
Loading "connect_proxy.js" tasks...ERROR
>> TypeError: Cannot read property 'prototype' of undefined
Looks like some dependencies issues, look at this, apparently its solved if you update your "grunt-connect-proxy"
"devDependencies": {
"grunt-connect-proxy": "^0.2.0"
}
https://github.com/drewzboto/grunt-connect-proxy/issues/97

Resources