ReferenceError: module is not defined after MUP deploy - javascript

I'm using the latest version of Meteor (1.4.3.2), the latest version of MUP (1.2.6) and node v6.10.2 but can't get deploy to work successfully. MUP says that everything built, deployed, and started successfully but I get 502 Bad Gateway errors when connecting to my web site. Looking at MUP logs I see that there are problems downloading bcrypt during the deploy and that the app is continuously failing with the following error in mup.js:
/bundle/bundle/programs/server/node_modules/fibers/future.js:280
throw(ex);
^
ReferenceError: module is not defined
at app/mup.js:1:-27
at app/mup.js:59:4
at /bundle/bundle/programs/server/boot.js:303:34
at Array.forEach (native)
at Function._.each._.forEach (/bundle/bundle/programs/server/node_modules/underscore/underscore.js:79:11)
at /bundle/bundle/programs/server/boot.js:128:5
at /bundle/bundle/programs/server/boot.js:352:5
at Function.run (/bundle/bundle/programs/server/profile.js:510:12)
at /bundle/bundle/programs/server/boot.js:351:11
The undefined "module" reference is in the mup.js file that MUP INIT builds: "module.exports = {".
Any suggestions other than don't use MUP? I'm deploying to DigitalOcean running Ubuntu 14.04 x64 vmlinuz-3.13.0-57-generic, not that it should matter.

Related

E/launcher - Error: TypeError: Cucumber.Cli is not a function

While implementing BDD I developed a test using protractor, cucumber and protractor-cucumber framework.
I don't know what to do with the index.js file.
While running the tests I'm getting the error:
"E/launcher - Error: TypeError: Cucumber.Cli is not a function"
I am using:
cucumber#2.0.0-rc2
protractor#4.0.13
protractor-cucumber-framework#0.6.0
Here is the detailed error message:
[11:22:34] I/hosted - Using the selenium server at http://127.0.0.1:4444/wd/hub
[11:22:34] I/launcher - Running 1 instances of WebDriver
[11:22:37] E/launcher - Error: TypeError: Cucumber.Cli is not a function
at C:\Users\jxm\Documents\Visual Studio 2015\Projects\ProtractorCucumber_FromScratch\ProtractorCucumber_FromScratch\node_modules\protractor-cucumber-framework\index.js:31:16
at Function.promise (C:\Users\jxm\Documents\Visual Studio 2015\Projects\ProtractorCucumber_FromScratch\ProtractorCucumber_FromScratch\node_modules\q\q.js:682:9)
at C:\Users\jxm\Documents\Visual Studio 2015\Projects\ProtractorCucumber_FromScratch\ProtractorCucumber_FromScratch\node_modules\protractor-cucumber-framework\index.js:24:14
at _fulfilled (C:\Users\jxm\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (C:\Users\jxm\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (C:\Users\jxm\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13)
at C:\Users\jxm\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49
at runSingle (C:\Users\jxm\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13)
at flush (C:\Users\jxm\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
[11:22:37] E/launcher - Process exited with error code 100
I had this problem yesterday - for some reason it doesnt work work when installing cucumber#2.0.0-rc2
I believe its because when installing protractor-cucumber-framework its says : UNMET PEER DEPENDENCY cucumber#2.0.0-rc.2
so seems this version of cucumber is incompatible.
I did: npm install --save-dev cucumber#1.3.1
Then it worked. I believe this is a protractor-cucumber-framework problem
Cucumber#2.0.0 has some breaking changes to the cucumber cli, this is breaking the protractor-cucumber-framework which is written using an older version of cucumber.
An issue has already been logged in the official protractor-cucumber-framework github repo.
Work Around for now would be to downgrade your cucumber version.

How to run openshift MEAN project in localhost or development system Ubuntu?

I have created a MEAN stack application on https://openshift.redhat.com/ and it was successfully running on the web.
Default source code of the project synced form: https://github.com/linnovate/mean-on-openshift.git
For further development I am cloning the hosted git source using using git url mentioned in the applications page. (e.g git clone ssh://55e86e9f89f5cf1d29000001#nodejs-tapslab.rhcloud.com/~/git/nodejs.git/).
After clone the source code to local system, opening the project in sublime text editor. I can see in the config/env/development.js there are lot of configuration are used like process.env.OPENSHIFT_XXX. I was changed the some config value mentioned below and trying to start server using command : 'node server', but server was not starting throwing error.
{
db: db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost:27017') + ':' + '/mean-dev',
hostname: process.env.OPENSHIFT_NODEJS_IP || 'http://localhost:3000'
}
Can someone help me how to run Openshift mean project in local system and what all configuration needed before running it in local system.
System Config :
Ubuntu 12.04
MongoDB v2.6.6
Nodejs v0.10.40
npm 1.4.28
grunt-cli v0.1.13
Error :
$ node server
Mean app started on port 3000 (development)
events.js:72
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND
at errnoException (dns.js:37:11)
at Object.onanswer [as oncomplete] (dns.js:124:16)
Git:
$ NODE_ENV=test node server

error when trying to deploy with nodejitsu

I have a Windows 7 / 64bit machine and currenlty trying to deploy node.js based project to nodejitsu. But it do not works as expected and crash with error:
Executing command deploy
info: Welcome to Nodejitsu yourapp
info: jitsu v0.13.15, node v0.11.10
info: It worked if it ends with Nodejitsu ok
warn: You are using unstable version of node.js. You may experience problems.
info: Executing command deploy
c:\Users\User\AppData\Roaming\npm\node_modules\jitsu\lib\jitsu\package.js:248
jitsu.log.warn(line);
^
TypeError: Cannot call method 'warn' of undefined
at c:\Users\User\AppData\Roaming\npm\node_modules\jitsu\lib\jitsu\package.js:248:17
at Array.forEach (native)
at c:\Users\User\AppData\Roaming\npm\node_modules\jitsu\lib\jitsu\package.js:247:10
at c:\Users\User\AppData\Roaming\npm\node_modules\jitsu\node_modules\flatiron\node_modules\broadway
\node_modules\utile\node_modules\async\lib\async.js:94:25
at checkProperty (c:\Users\User\AppData\Roaming\npm\node_modules\jitsu\lib\jitsu\package.js:202:5)
at c:\Users\User\AppData\Roaming\npm\node_modules\jitsu\node_modules\flatiron\node_modules\broadway
\node_modules\utile\node_modules\async\lib\async.js:86:13
at Array.forEach (native)
at _forEach (c:\Users\User\AppData\Roaming\npm\node_modules\jitsu\node_modules\flatiron\node_module
s\broadway\node_modules\utile\node_modules\async\lib\async.js:26:24)
at Object.async.forEach (c:\Users\User\AppData\Roaming\npm\node_modules\jitsu\node_modules\flatiron
\node_modules\broadway\node_modules\utile\node_modules\async\lib\async.js:85:9)
at Object.package.validate (c:\Users\User\AppData\Roaming\npm\node_modules\jitsu\lib\jitsu\package.
js:205:9)
So what is the problem there and how it's possible to solve it?

Apache cordova ,Unable to create an app

This is the output , knowing that i'm running it under a proxy , and i specified the proxy settings.
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
then i run this command to create a new app in the specified folder "hello".
C:\>cordova create hello com.example.hello HelloWorld
Creating a new cordova project with name "HelloWorld" and id "com.example.hello"
at location "C:\hello"
Downloading cordova library for www...
this is the error :
Error: connect ETIMEDOUT
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)
I recently had the same issue. I was maintaining an existing app and updating Cordova was well beyond the scope of the current task, so getting this working was really my only option.
Firstly, in order to eliminate all the errors and warnings about deprecated APIs when installing Cordova, I had to use some really ancient package managers. Using NVM I installed node 0.10.48 and npm 1.4.29. Cordova 3.6.3 then installed without any complaints.
But even creating an empty Cordova project wasn't possible as the below output shows:
Creating a new cordova project with name "HelloWorld" and id "com.example.hello" at location "~/Downloads"
Downloading cordova library for www...
Error: HTTP error 404 retrieving version 3.6.3 of cordova for www
at Request._callback (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/lazy_load.js:230:30)
at Request.self.callback (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/request/index.js:148:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/request/index.js:886:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (~/.nvm/v0.10.48/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/request/index.js:837:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:458:13)
Adding some extra debug output to lazy_load.js revealed that the CLI was looking for a directory at ~/.cordova/lib/www/cordova/3.6.3.
Since this was a brand new installation of Cordova, that directory obviously wasn't present so it went to download an archive from https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-world.git;a=snapshot;h=3.6.3;sf=tgz but the archive that used to be there has apparently been removed. I found it at https://github.com/apache/cordova-app-hello-world/releases/tag/3.6.3.
I download that archive and extracted it to ~/.cordova/lib/www/cordova/3.6.3, and I was then able to create my template app.
I know this thread is old but I really hope this helps someone. Working with Cordova is a bitch at the best of times, let alone when vital online components are removed like this.
On OSX Yosemite even with sudo the error persists.
after digging a little bit more. i found the solution.
I have just run the cmd.exe as administrator. after that worked like magic.
I ran into this problem by not installing cordova as admin. I had to sudo npm install -g cordova to get the create command to work.

socket.io errors when client connects

I have socket.io running successfully on my node.js installation.
info - socket.io started
The console shows it running ok, but as soon as the client (browser) connects:
socket = io.connect('<my host>:8000');
The console is kicking out an error:
crypto.js:123
return new Hash(hash);
^
TypeError: undefined is not a function
at Object.createHash (crypto.js:123:10)
at WebSocket.onSocketConnect (/node_modules/socket.io/lib/transports/websocket/hybi-16.js:120:23)
at WebSocket.handleRequest (/node_modules/socket.io/lib/transport.js:71:10)
at WebSocket.Transport (/node_modules/socket.io/lib/transport.js:31:8)
at new WebSocket (/node_modules/socket.io/lib/transports/websocket/hybi-16.js:59:13)
at new WebSocket (/node_modules/socket.io/lib/transports/websocket.js:31:17)
at Manager.handleClient (/node_modules/socket.io/lib/manager.js:661:19)
at Manager.handleUpgrade (/node_modules/socket.io/lib/manager.js:618:8)
at Server.<anonymous> (/node_modules/socket.io/lib/manager.js:123:10)
at Server.emit (events.js:88:20)
can anyone understand what this might mean?
My code has been working fine on my local machine, its only when moving it to my production server does this error happen.
It turns out it's because Node was installed with the option --without-ssl. This means it doesnt install any of the crypto stuff, which was needed by socket.it. I installed openssl, reinstalled Node, and this fixed it :)

Categories

Resources