Mup Deploy dont work on AWS - javascript

i will explain my problem, im trying to deploy an Meteor App on EC2 AWS (Ubuntu 16), the code is download from bitbucket and i was trying deploy with Mup.
Mup Setup has no problems, but when using the Mup deploy command, it progresses to "minifying app code" and never goes forward.
Meteor 1.7.0.4
node v 10.9.0
mup --version
1.4.5
Attach the Mup.js file and the putty session
module.exports = {
servers: {
one: {
// TODO: set host address, username, and authentication method
host: 'xxxx',
username: 'ubuntu',
pem: '../xxxx.pem'
// password: 'server-password'
// or neither for authenticate from ssh-agent
}
},
app: {
// TODO: change app name and path
name: 'xxxx',
path: '../',
servers: {
one: {},
},
buildOptions: {
serverOnly: true,
executable: 'meteor'
},
env: {
ROOT_URL: 'http://xxxx',
MONGO_URL: 'mongodb://mongodb/meteor',
MONGO_OPLOG_URL: 'mongodb://mongodb/local',
},
docker: {
// change to 'abernix/meteord:base' if your app is using Meteor 1.4 - 1.5
image: 'abernix/meteord:node-8.4.0-base',
},
enableUploadProgressBar: true,
deployCheckWaitTime: 120,
},
mongo: {
version: '3.4.1',
servers: {
one: {}
}
},
};
Putty Session
Using username "ubuntu".
Authenticating with public key "imported-openssh-key"
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.4.0-1065-aws x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud
28 packages can be updated.
0 updates are security updates.
New release '18.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Fri Aug 17 22:06:59 2018 from xxxx
ubuntu#xxxx:~$ meteor --version
Meteor 1.7.0.4
ubuntu#xxxx:~$ node -v
v10.9.0
ubuntu#xxxx:~$ mup --version
1.4.5
ubuntu#xxxx:~$ cd xxxx
ubuntu#xxxx:~/xxxx$ cd .deploy
ubuntu#xxxx:~/xxxx/.deploy$ mup status
=> Servers
- xxxx: Ubuntu 16.04
=> Docker Status
- xxxx: 18.06.0-ce Running
=> Meteor Status
- xxxx: created
Created at 2018-08-17T16:17:42.747786756Z
Restarted 0 times
ENV:
- ROOT_URL=http://xxxx
- MONGO_URL=mongodb://mongodb:27017/xxxx
- MONGO_OPLOG_URL=mongodb://mongodb/local
- METEOR_SETTINGS={"public":{}}
- PORT=80
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- METEORD_DIR=/opt/meteord
- NODE_VERSION=8.4.0
Published Ports:
- 80/tcp => 80
App running at http://xxxx:80
- Available in app's docker container: false
- Available on server: false
- Available on local computer: false
=> Mongo Status
running on server xxxx
Restarted 0 times
Running since 2018-08-17T21:41:02.553644287Z
Version: 3.4.1
Connections: 1
Storage Engine: wiredTiger
ubuntu#xxxx:~/xxxx/.deploy$ mup setup
Started TaskList: Setup Docker
[xxxx] - Setup Docker
[xxxx] - Setup Docker: SUCCESS
Started TaskList: Setup Meteor
[xxxx] - Setup Environment
[xxxx] - Setup Environment: SUCCESS
Started TaskList: Setup Mongo
[xxxx] - Setup Environment
[xxxx] - Setup Environment: SUCCESS
[xxxx] - Copying mongodb.conf
[xxxx] - Copying mongodb.conf: SUCCESS
Started TaskList: Start Mongo
[xxxx] - Start Mongo
[xxxx] - Start Mongo: SUCCESS
Next, you should run:
mup deploy
ubuntu#xxxx:~/xxxx/.deploy$ mup deploy --verbose settings settings.json
Building App Bundle Locally
Minifying app code
After several minutes the connection with the instance is lost and I have to restart it, please help me with this problem that i never had before and i need fix soon. Thanks!
I tried "mup deploy --verbose --settings settings.json" command with a very basic app in the same instance of AWS, and get pass the "minifiying" problem, but throw the next error:
Next, you should run:
mup deploy
ubuntu#xxxx/.deploy$ mup deploy --verbose --settings settings.json
Building App Bundle Locally
Started TaskList: Pushing Meteor App
[xxxx] - Pushing Meteor App Bundle to the Server
[xxxx] - Pushing Meteor App Bundle to the Server: SUCCESS
[xxxx] - Prepare Bundle
base: Pulling from abernix/meteord
...
Digest: sha256:5138e4ba3c55cc6fabe0ba859f984e9725599a9f53ed5d759dd4f350770a62b2
Status: Downloaded newer image for abernix/meteord:base
Finished Extracting
Creating Dockerfile
Finished creating Dockerfile
Building image
Sending build context to Docker daemon 67.59MB
Step 1/7 : FROM abernix/meteord:base
# Executing 1 build trigger
---> Running in cf74d5b4fa68
Removing intermediate container cf74d5b4fa68
---> 1f37c25d0989
Step 2/7 : RUN mkdir /built_app || true
---> Running in 1aee7bfde84f
Removing intermediate container 1aee7bfde84f
---> f82f6ad23a8a
Step 3/7 : ENV ROOT_URL=xxxx
---> Running in f26ac397298a
Removing intermediate container f26ac397298a
---> c2eb2e8861f7
Step 4/7 : ENV MONGO_URL=mongodb://mongodb:27017/xxxx
---> Running in be1f89f57b08
Removing intermediate container be1f89f57b08
---> 877e22ea42db
Step 5/7 : ENV MONGO_OPLOG_URL=mongodb://mongodb/local
---> Running in 7801b4f3be1e
Removing intermediate container 7801b4f3be1e
---> 657785f145b4
Step 6/7 : COPY ./ /built_app
---> 3043416670e1
Step 7/7 : RUN cd /built_app/programs/server && npm install --unsafe-perm
---> Running in d2ae3b014734
...
Removing intermediate container d2ae3b014734
---> df4a55163cc2
Successfully built df4a55163cc2
Successfully tagged mup-xxxx:build
Error response from daemon: No such image: mup-xxxx:latest
Total reclaimed space: 0B
[xxxx] - Prepare Bundle: SUCCESS
Started TaskList: Configuring App
[xxxx] - Pushing the Startup Script
[xxxx] - Pushing the Startup Script : SUCCESS
[xxxx] - Sending Environment Variab les
[xxxx] - Sending Environment Variab les: SUCCESS
Started TaskList: Start Meteor
[xxxx] - Start Meteor
using image
Error: No such image: mup-xxxx:previous
Image mup-xxxx:latest
Volume
Removing docker containers. Errors about nonexistent endpoints and containers ar e normal.
Error: No such container: xxxx
Error response from daemon: endpoint xxxx not found
Error: No such container: xxxx-frontend
Error response from daemon: endpoint xxxx-frontend not found
Error: No such container: xxxx-nginx-letsencrypt
Error response from daemon: endpoint xxxx-nginx-letsencrypt not found
Error: No such container: xxxx-nginx-proxy
Error response from daemon: endpoint xxxx-nginx-proxy not found
Finished removing docker containers
0e23b10725796947401ab151a78b2349f32a3779249f3847d20f1b82d2c251a4
Ran abernix/meteord:base
[xxxx] - Start Meteor: SUCCESS
[xxxx] - Verifying Deployment
Container has no IP Address, likely from the app crashing.
Container has no IP Address, likely from the app crashing.
=> Container status:
Container spent too much time restarting.
restarted: 8 times {"Bridge":"","SandboxID":"d97cbb37a87106a3bdeaa51022acabd5e13 66a52317d11fcd75a3593730349bd","HairpinMode":false,"LinkLocalIPv6Address":"","Li nkLocalIPv6PrefixLen":0,"Ports":{},"SandboxKey":"/var/run/docker/netns/d97cbb37a 871","SecondaryIPAddresses":null,"SecondaryIPv6Addresses":null,"EndpointID":""," Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"IPAddress":"","IPPre fixLen":0,"IPv6Gateway":"","MacAddress":"","Networks":{"bridge":{"IPAMConfig":nu ll,"Links":null,"Aliases":null,"NetworkID":"081a5c91dc08e96e9a6efc23130e8e602951 1153751498da778dac3c9a8beb9d","EndpointID":"","Gateway":"","IPAddress":"","IPPre fixLen":0,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAd dress":"","DriverOpts":null}}} {"Status":"restarting","Running":true,"Paused":fa lse,"Restarting":true,"OOMKilled":false,"Dead":false,"Pid":0,"ExitCode":1,"Error ":"","StartedAt":"2018-08-20T20:08:58.615954182Z","FinishedAt":"2018-08-20T20:08 :58.900441472Z"}
=> Logs:
at require (internal/module.js:12:17)
at Object.<anonymous> (/built_app/main.js:4:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
=> Starting meteor app on port:80
/built_app/programs/server/boot.js:49
const { pause } = require("./debug.js");
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/built_app/main.js:4:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
=> Starting meteor app on port:80
/built_app/programs/server/boot.js:49
const { pause } = require("./debug.js");
^
Module._extensions..js (module.js:416:10)
To see more logs type 'mup logs --tail=200'
[xxxx] x Verifying Deployment: FAIL ED
------------------------------------STDERR------------------------ ------------
Container spent too much time restarting.
at require (internal/module.js:12:17)
at Object.<anonymous> (/built_app/main.js:4:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
=> Starting meteor app on port:80
/built_app/programs/server/boot.js:49
const { pause } = require("./debug.js");
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/built_app/main.js:4:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
=> Starting meteor app on port:80
/built_app/programs/server/boot.js:49
const { pause } = require("./debug.js");
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/built_app/main.js:4:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
=> Starting meteor app on port:80
/built_app/programs/server/boot.js:49
const { pause } = require("./debug.js");
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/built_app/main.js:4:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
=> Starting meteor app on port:80
/built_app/programs/server/boot.js:49
const { pause } = require("./debug.js");
^
------------------------------------STDOUT------------------------ ------------
Container has no IP Address, likely from the app crashing.
Container has no IP Address, likely from the app crashing.
Container has no IP Address, likely from the app crashing.
Container has no IP Address, likely from the app crashing.
=> Container status:
restarted: 8 times {"Bridge":"","SandboxID":"d97cbb37a87106a3bdeaa51022a cabd5e1366a52317d11fcd75a3593730349bd","HairpinMode":false,"LinkLocalIPv6Address ":"","LinkLocalIPv6PrefixLen":0,"Ports":{},"SandboxKey":"/var/run/docker/netns/d 97cbb37a871","SecondaryIPAddresses":null,"SecondaryIPv6Addresses":null,"Endpoint ID":"","Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"IPAddress":" ","IPPrefixLen":0,"IPv6Gateway":"","MacAddress":"","Networks":{"bridge":{"IPAMCo nfig":null,"Links":null,"Aliases":null,"NetworkID":"081a5c91dc08e96e9a6efc23130e 8e6029511153751498da778dac3c9a8beb9d","EndpointID":"","Gateway":"","IPAddress":" ","IPPrefixLen":0,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen": 0,"MacAddress":"","DriverOpts":null}}} {"Status":"restarting","Running":true,"Pa used":false,"Restarting":true,"OOMKilled":false,"Dead":false,"Pid":0,"ExitCode": 1,"Error":"","StartedAt":"2018-08-20T20:08:58.615954182Z","FinishedAt":"2018-08- 20T20:08:58.900441472Z"}
=> Logs:
To see more logs type 'mup logs --tail=200'
------------------------------------------------------------------ ------------

Related

throwing connection Error after uploading the nodejs code on live server however working fine on localhost . I was using mssql to establish connection

I have uploaded the code on the live server .but whenever I hit the URL (http://hrm.azeemaftab.com/) I am getting following Error:-
iisnode encountered an error when processing the request.
HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error
You are receiving this HTTP 200 response because system.webServer/iisnode/#devErrorsEnabled configuration setting is 'true'.
In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.
The last 64k of the output generated by the node.exe process to stderr is shown below:
Application has thrown an uncaught exception and is terminated:
E:\Inetpub\vhosts\azeemaftab.com\hrm.azeemaftab.com\node_modules\mssql\lib\tedious\connection-pool.js:39
cfg.options.connectTimeout = cfg.options.connectTimeout ?? this.config.connectionTimeout ?? this.config.timeout ?? 15000
^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (E:\Inetpub\vhosts\azeemaftab.com\hrm.azeemaftab.com\node_modules\mssql\lib\tedious\index.js:4:24)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
here is my database connection code config.js
const config = {
user:"user",
password: process.env.PASSWORD,
database:"********",
server:"*****",
port : *****,
TrustServerCertificate : true,
options: {
trustedConnection: true,
encrypt: true,
enableArithAbort: true,
trustServerCertificate: true,
},
};
I don't know why I am getting this error . while It is working fine on localhost.
You should check what version of the node the live server is running. You need to be running node version 14 or higher.

Express Not Installing

I know that this has been asked before but none of the solutions worked for me. Whenever I try to install express, it seems to work just fine, displaying this message:
npm WARN website#1.0.0 No description
+ express#4.17.1
updated 1 package and audited 50 packages in 6.581s
found 0 vulnerabilities
However, when I try to run my program that uses express:
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (C:\Users\darcy\OneDrive\Sutton\Website\server.js:2:15)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
code: 'MODULE_NOT_FOUND',`
Here is my code:
let express = require("express");
let account = require("accountBack");
let shop = require("shopBack")
let serverConnection = express();
serverConnection.listen(3000, () => {});
serverConnection.use(express.static("public"));
serverConnection.use(express.json());
serverConnection.post("/account", account.accountServer);
serverConnection.get("/shop", shop.sendShop);
I am using code from other files (hence the
extra 2 require statements) but what they do I do not believe to be significant.
Here are the commands that I am typing in:
npm init
npm install express
node server.js
It does not appear from the error that express is gettinginstalled correctly, but I'm not sure. Is it a problem with the commands that I a typing in or something else? Any help would be appreciated.
For the internal module, you should import like this
const account = require("./accountBack");
const shop = require("./shopBack")
Unless you publish those modules to npm registry (private/public), then you can import like what you did.

Gridsome build failing with TypeError

I'm encountering some trouble running Gridsome build on a starter project template. The site runs on localhost with no problem. I tried npm install gridsome#latest to update or install any missing packages.
Gridsome build gives me the following error:
Could not generate HTML for "/work/":
TypeError: Cannot read property 'console' of null
at Object. (C:\Users\Micah\Desktop\my-gridsome-site\node_modules\vue-meta\dist\vue-meta.common.js:103:23)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at C:\Users\Micah\Desktop\my-gridsome-site\node_modules\vue-server-renderer\build.prod.js:1:77671
at Object. (webpack:/external "vue-meta":1:0)
The code at vue-meta.common.js:103:23 reads var console = _global.console || {}; as shown below:
var hasGlobalWindow = hasGlobalWindowFn();
var _global = hasGlobalWindow ? window : global;
var console = _global.console || {};
function warn(str) {
/* istanbul ignore next */
if (!console || !console.warn) {
return;
}
console.warn(str);
}
var showWarningNotSupported = function showWarningNotSupported() {
return warn('This vue app/component has no vue-meta configuration');
};
Steps to reproduce
Run gridsome build from command line.
Environment
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-4210U CPU # 1.70GHz
Binaries:
Node: 10.16.3 - C:\Program Files\nodejs\node.EXE
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.18362.449.0
npmPackages:
gridsome: ^0.7.11 => 0.7.11
gridsome-plugin-tailwindcss: ^2.2.26 => 2.2.26
I think the problem is only in build because of lack of SSR (server side rendering) of your component. There is no window in build mode. Try to wrap your component inside vue's <template> tag with <ClientOnly> tag like this:
<template>
<ClientOnly>
<my-component />
</ClientOnly>
</template>

node.js SyntaxError: Unexpected token { in Version v0.10.43

I habe the following line of code in my js file:
const { connectDb } = require("./db");
When I run nodejs locally everthing is fine and I dont get an error.
Im using v10.16.0 locally. When I put that on a server, I got the follwoing error:
2019-07-23 15:49:36.925754500 const { connectDb } = require("./db");
2019-07-23 15:49:36.925779500 ^
2019-07-23 15:49:36.930604500 SyntaxError: Unexpected token {
2019-07-23 15:49:36.930606500 at Module._compile (module.js:439:25)
2019-07-23 15:49:36.930607500 at Object.Module._extensions..js (module.js:474:10)
2019-07-23 15:49:36.930608500 at Module.load (module.js:356:32)
2019-07-23 15:49:36.930609500 at Function.Module._load (module.js:312:12)
2019-07-23 15:49:36.930610500 at Function.Module.runMain (module.js:497:10)
2019-07-23 15:49:36.930611500 at startup (node.js:119:16)
2019-07-23 15:49:36.930612500 at node.js:945:3
I'm running Version v0.10.43 on that server. What am I doing wrong?
I'm running Version v0.10.43 on that server. What am I doing wrong?
You're running v0.10.43.
Is it too old to support destructuring (which was added in 6.0.0 … which is also past end of life!).
You could replace it with:
const connectDb = require("./db").connectDb
… but are likely to run into other problems down the line.
v0.10.43 is from 2013. It is over half a decade old. It is past the end of life. It is not supported. It does not get security releases. Don't use it.
Use a supported version instead.

Unable to run appjs sample app using node.js

I am trying to run one of the sample projects using appjs which is present over here https://github.com/appjs/appjs/tree/master/examples. I am using the latest version of node.js (v4.1.0
) on Windows (64 bit machine)
When I try and run the example using the below command on Command Prompt
node --harmony index.js
I get an error as follows,
Error: AppJS requires Node is run with the --harmony command line flag
at Object.<anonymous> (F:\programs\appjs_examples\node_modules\appjs\lib\ind
ex.js:2:9)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
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> (F:\programs\appjs_examples\octosocial\index.js:1:73)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
I tried searching for this issue but I couldn't find a solution. Can anyone tell me how to use node.js with the harmony flag?
UPDATE
My index.js looks like this
var app = require('appjs'),
github = new (require('github'))({ version: '3.0.0' }),
KEY_F12 = process.platform === 'darwin' ? 63247 : 123;
app.serveFilesFrom(__dirname + '/assets');
var window = app.createWindow({
width: 460,
height: 640,
resizable: false,
disableSecurity: true,
icons: __dirname + '/assets/icons'
});
window.on('create', function(){
window.frame.show();
window.frame.center();
});
window.on('ready', function(){
var $ = window.$,
$username = $('input[name=username]'),
$password = $('input[name=password]'),
$info = $('#info-login'),
$label = $info.find('span'),
$buttons = $('input, button');
$(window).on('keydown', function(e){
if (e.keyCode === KEY_F12) {
window.frame.openDevTools();
}
});
$username.focus();
$('#login-form').submit(function(e){
e.preventDefault();
$info.removeClass('error').addClass('success');
$label.text('Logging in...');
$buttons.attr('disabled', true);
github.authenticate({
type: 'basic',
username: $username.val(),
password: $password.val()
});
github.user.get({}, function(err, result) {
if (err) {
$info.removeClass('success').addClass('error');
$label.text('Login Failed. Try Again.');
$buttons.removeAttr('disabled');
} else {
loggedIn(result);
}
});
});
function loggedIn(result){
$label.text('Logged in!');
$('#user-avatar').append('<img src="'+result.avatar_url+'" width="64" height="64">');
$('#user-name').text(result.name);
$('#login-section').hide();
$('#profile-section').show();
['Followers', 'Following'].forEach(function(type){
github.user['get'+type]({ user: result.login }, populate.bind(null, type.toLowerCase()));
});
}
Now with v0.12 of Node.js I get below error
F:\softwares\Node.js_v0.12\node_modules\appjs\lib\index.js:2
throw new Error ('AppJS requires Node is run with the --harmony command line
Error: AppJS requires Node is run with the --harmony command line flag
at Object.<anonymous> (F:\softwares\Node.js_v0.12\node_modules\appjs\lib\ind
ex.js:2:9)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
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> (F:\softwares\Node.js_v0.12\index.js:1:73)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
Just tested your code out locally with node v0.12.7 and v4.0.0. Looks like the node_modules/appjs/lib/index.js check makes sure that proxy is enabled no matter what.
By default the --harmony flag does not enable proxies. However you can use --harmony_proxies.
To help you understand what is happening:
Open node in your terminal, Then type Proxy. You will get 'Proxy is not defined'.
Now, open node --harmony in your terminal and do the same. You will get the same output.
Now, with node --harmony-proxies. Bam, you get an empty object.
You should be able to run this with v4.x.x however, you will still need the proxies flag for harmony.
When the merge happened with node.js and io.js for v4 they released a page of ES6 features that are shipped if you are using 4.x.x. https://nodejs.org/en/docs/es6/
https://github.com/appjs/appjs is deprecated btw, but once you pass the module's test of features, it will require 32bit ;)
Edit:
To properly run your app use the following:
node --harmony-proxies index.js
Here is a screenshot to show the expected output from step 3 above.

Categories