Intel Edison Johnny five error - intel-edison

I have been trying to run my hello-worlds.js file on my intel Edison (shown below):
var five = require("johnny-five");
var Edison = require("galileo-io");
var board = new five.Board({
io: new Edison()
});
board.on("ready", function() {
var led = new five.Led(13);
led.blink(500);
});
I have installed Node.js, I also used npm install galileo-io johnny-five and downloaded files to my file directory of folder my-robotics-project.
When i execute using node hello-worlds.js, I get the following error:
This OS image is no longer supported.
Please upgrade to IoTkit Image with libmraa0 support
c:\User\Mohamed\my-robotics-project\node_modules\galileo\lib\galileo.js:66
if <Pin.IO.getPlatformType<> === 2> {
TypeError: Cannot read property 'getPlatformType' of undefined
at Object.<anonymous> <c:\User\Mohamed\my-robotics-
project\node_modules\galileo\lib\galileo.js:66:11>
at Module._compile <module.js:435:26>
at Object.Module.extensions..js <module.js:442:10>
at Module.load <module.js:356:32>
at function.Module._load <module.js:311:12>
at Module.require <module.js:366:17>
at require <module.js:385:17>
at Object.<anonymous> <c:\User\Mohamed\my-robotics-project\hello-
worlds.js:2:14>
at Module._compile <module.js:435:26>
at Object.Module._extensions..js <module.js:442:10>

Related

VSCode freezing upon startup

VSCode is freezing upon starting in CentOS 7 (Linux smcr-centos7-x64-vm0 3.10.0-1160.25.1.el7.x86_64) when I install/use any version newer than 1.52. It comes up but I can't click anything in the window and it practically cripples my VM. I also don't see anything in the launch window. Here's the output of "code --list-extensions":
Anyone have any suggestions?
Error: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/share/code/resources/app/node_modules.asar.unpacked/spdlog/build/Release/spdlog.node)
at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1185:18)
at Object.func [as .node] (electron/js2c/asar_bundle.js:5:2073)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Module._load (internal/modules/cjs/loader.js:823:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12684)
at Module.require (internal/modules/cjs/loader.js:1006:19)
at require (internal/modules/cjs/helpers.js:88:18)
at bindings (/usr/share/code/resources/app/node_modules.asar/bindings/bindings.js:112:48)
at Object.<anonymous> (/usr/share/code/resources/app/node_modules.asar/spdlog/index.js:3:35)
at Module._compile (internal/modules/cjs/loader.js:1125:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Module._load (internal/modules/cjs/loader.js:823:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12684)
at Module.require (internal/modules/cjs/loader.js:1006:19)
at require (internal/modules/cjs/helpers.js:88:18)
at t (/usr/share/code/resources/app/out/vs/loader.js:5:101)
at r.load (/usr/share/code/resources/app/out/vs/loader.js:4:1719)
at r.load (/usr/share/code/resources/app/out/vs/loader.js:3:10262)
at l (/usr/share/code/resources/app/out/vs/loader.js:5:10314)
at Object.errorback (/usr/share/code/resources/app/out/vs/loader.js:5:10435)
at r.triggerErrorback (/usr/share/code/resources/app/out/vs/loader.js:3:10626)
at /usr/share/code/resources/app/out/vs/loader.js:3:10332
at r.load (/usr/share/code/resources/app/out/vs/loader.js:4:1736)
at r.load (/usr/share/code/resources/app/out/vs/loader.js:3:10262)
at l (/usr/share/code/resources/app/out/vs/loader.js:5:10314)
at r._loadModule (/usr/share/code/resources/app/out/vs/loader.js:5:10444)
at r._resolve (/usr/share/code/resources/app/out/vs/loader.js:6:452)
at r.defineModule (/usr/share/code/resources/app/out/vs/loader.js:5:6145)
at r._relativeRequire (/usr/share/code/resources/app/out/vs/loader.js:5:6831)
at n (/usr/share/code/resources/app/out/vs/loader.js:5:9420)
at y (/usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js:14:20443)
at new Promise (<anonymous>)
at b (/usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js:14:20423)
at L._createSpdLogLogger (/usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js:14:21356)
at new L (/usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js:14:21172)
at P.initServices (/usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js:17:45235)
at async P.run (/usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js:17:44511)
at async Object.D [as main] (/usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js:17:48104)
at async E (/usr/share/code/resources/app/out/vs/code/node/cli.js:12:14219) {
phase: 'loading',
moduleId: 'spdlog',
neededBy: [ '===anonymous5===' ]
}
aaron-bond.better-comments
albert.TabOut
alefragnani.project-manager
arturock.gitstash
bradgashler.htmltagwrap
christian-kohler.npm-intellisense
christian-kohler.path-intellisense
CoenraadS.bracket-pair-colorizer
DavidAnson.vscode-markdownlint
dbaeumer.vscode-eslint
eamodio.gitlens
ecmel.vscode-spring-boot
EditorConfig.EditorConfig
esbenp.prettier-vscode
formulahendry.auto-close-tag
formulahendry.auto-rename-tag
humao.rest-client
jebbs.plantuml
kevinkyang.auto-comment-blocks
mads-hartmann.bash-ide-vscode
mongodb.mongodb-vscode
ms-azuretools.vscode-docker
ms-python.python
ms-toolsai.jupyter
ms-vscode.cpptools
oderwat.indent-rainbow
philsinatra.nested-comments
Pivotal.vscode-boot-dev-pack
Pivotal.vscode-concourse
Pivotal.vscode-manifest-yaml
Pivotal.vscode-spring-boot
purplestone.savebackup
redhat.java
redhat.vscode-commons
redhat.vscode-xml
redhat.vscode-yaml
rogalmic.bash-debug
shakram02.bash-beautify
stkb.rewrap
streetsidesoftware.code-spell-checker
TomiTurtiainen.rf-intellisense
trixnz.go-to-method
vilicvane.sensitive-replace
vincaslt.highlight-matching-tag
VisualStudioExptTeam.vscodeintellicode
vscjava.vscode-java-debug
vscjava.vscode-java-dependency
vscjava.vscode-java-pack
vscjava.vscode-java-test
vscjava.vscode-maven
vscjava.vscode-spring-boot-dashboard
vscjava.vscode-spring-initializr
vscodevim.vim
wix.glean
wmaurer.change-case
xaver.clang-format
yzhang.markdown-all-in-one

Issue in export and import ES6 Classes in protractor testing

I'm facing two issues while using ES6 class export and import. First, while import, methods cannot be accessible from imported class. Second, while executing the code through visual studio code im facing the following error "SyntaxError: Unexpected token import". Please provide correction or suggestion.
Below are my my class file "Login_pageobj.js"
export default class Login_pageobj {
constructor() {
//userName
this.enterUserName = element(by.xpath('//input[#id="username"]'));
//Password
this.enterPassword = element(by.xpath('//input[#id="password"]'));
//Login Button
this.clickLoginBtn = element(by.buttonText('LOGIN'));
//invalid UserName Password Error
this.inValErrMsg = element(by.xpath('//div[#class="subtext"]'));
}
//Please enter a user name (required). method
isDisplyedUserNameErrorMsg() {...}
This below code is My Protractor spec file Login_spec.js
import Login_pageobj from '../ES6_pageobj/login_pageobj';
describe('Login Page Validation', function() {
it('Launch Commercial URL',function(){
browser.get('http://applicationurl');
browser.manage().window().maximize();
expect(browser.getTitle()).toBe('LoginWeb');
});
it('Login Button should Disabled',function(){
console.log('----------------------------------------------------');
let lgin_pgobj = new login_pageobj();
lgin_pgobj.verifyLgnBtnEnabled();//***unable to access this method***
});
});
While run this code through Visual studio code debugger i'm getting following error.
Debugging with inspector protocol because Node.js v8.9.1 was detected.
node --inspect-brk=23169 node_modules\protractor\bin\protractor
e:\CommercialPOC/conf.js --suite es6
Debugger listening on ws://127.0.0.1:23169/e3dfd326-8468-4a3a-a2e3-3094d97c5571
(node:4708) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
(node:4708) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
warning.js:18
[22:00:06] I/launcher - Running 1 instances of WebDriver
logger.js:155
[22:00:06] I/direct - Using ChromeDriver directly...
logger.js:155
null
conf.js:48
[22:00:25] E/launcher - Error:
e:\commercialPOC\ES6_moduleScenarios\0Login_spec.js:1
logger.js:155
(function (exports, require, module, __filename, __dirname) { import
Login_pageobj from '../ES6_pageobj/login_pageobj';
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at e:\CommercialPOC\node_modules\jasmine\lib\jasmine.js:93:5
[22:00:25] E/launcher - Process exited with error code 100
You should use such import constructure:
const Login_pageobj = require('../ES6_pageobj/login_pageobj')

Type Script : SyntaxError: Unexpected token

I am trying to Implement this simple typescript code. But having weird error while running through node command. Can someone please help?
Main.ts
class Wedding {
bond:string;
money:number;
isWeddingPossible() {
if(this.bond === 'Strong' && this.money > 10000 ){
console.log('Wedding can be done.');
}
else{
console.log("Go to hell");
}
}
}
let wedding = new Wedding();
wedding.bond = 'Not Strong';
wedding.money = 500;
wedding.isWeddingPossible();
Run commands : tsc main.ts && node main.ts
Error :
/ts-hello/main.ts:3
bond:string;
^
SyntaxError: Unexpected token :
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
You should run node main.js instead of main.ts. You compile your .ts file and it creates it's .js file. So you need to run that compiled .js file via node.

How to update a specific record from a class using the query builder in Orientjs (previously called oriento)?

I need to update a specific record in my User class. I don't have any field with a unique index so I need to use the #rid field.
How can I use orientjs to update a specific record with dynamic properties ?
I would like to use the query builder if possible because my updated record is in the request body.
Here is what I've tried :
var id = '#' + req.param('id');
db.update('User').set(req.body).where({#rid: id}).scalar()
.then(function (total) {
console.log('updated', total, 'users');
});
It gives me a syntax error because I cannot use the #rid in the where clause :
db.update('User').set(req.body).where({#rid: id}).scalar()
^
SyntaxError: Unexpected token ILLEGAL
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
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> (/Users/alexandre/Documents/bitbucket/rest-api/server/routes/index.js:4:12)
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> (/Users/alexandre/Documents/bitbucket/rest-api/server/server.js:25:14)
at Module._compile (module.js:460:26)
try
db.update(id).set(req.body).scalar()
where id is the #rid of the record you want to update

Keystone and openshift, getting 503 error

Can anyone please help me install keystone.js on my openshift app?
I've pushed all my files to the remote, but get a 503 error when I browse to my page. I'm quite new to Openshift, can anyone please point me in the right direction?
I have tried changing keystone.init to:
var connectionString = process.env.OPENSHIFT_MONGODB_DB_USERNAME + ":" + process.env.OPENSHIFT_MONGODB_DB_PASSWORD + "#" + process.env.OPENSHIFT_MONGODB_DB_HOST + dbName;
console.log(connectionString);
keystone.set('mongo', connectionString);
keystone.init({
'mongo': connectionString,
Still no joy, I dont get any console errors either.
Any advice much appreciated.
UPDATE: checked logs and found the following:
SyntaxError: Unexpected end of input
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/var/lib/openshift/5501b0c04382ecfefe0000a2/app-root/runtime/repo/node_modules/keystone/index.js:3:6)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
DEBUG: Program node keystone.js exited with code 8
DEBUG: Starting child process with 'node keystone.js'
hit me
/var/lib/openshift/5501b0c04382ecfefe0000a2/app-root/runtime/repo/node_modules/underscore/underscore.js:561
});
SyntaxError: Unexpected end of input
at Module._compile (module.js:439:25)
Keystone.js
// Simulate config options from your production environment by
// customising the .env file in your project's root folder.
// Require keystone
var keystone = require('keystone');
// Initialise Keystone with your project's configuration.
// See http://keystonejs.com/guide/config for available options
// and documentation.
var dbName = "node";
var connectionString = process.env.OPENSHIFT_MONGODB_DB_USERNAME + ":" + process.env.OPENSHIFT_MONGODB_DB_PASSWORD + "#" + process.env.OPENSHIFT_MONGODB_DB_HOST + dbName;
console.log(connectionString);
keystone.set('mongo', connectionString);
keystone.init({
'mongo': connectionString,
'name': 'node',
'brand': 'node',
'sass': 'public',
'static': 'public',
'favicon': 'public/favicon.ico',
'views': 'templates/views',
'view engine': 'jade',
'auto update': true,
'session': true,
'auth': true,
'user model': 'User',
'cookie secret': '^<S0$!?a778,)~[Fx4wQvgcTw]fWq.)<s`cAJc:bExU*(L&ty9;mSV?`am:*7f.P'
});
// Load your project's Models
keystone.import('models');
// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js
keystone.set('locals', {
_: require('underscore'),
env: keystone.get('env'),
utils: keystone.utils,
editable: keystone.content.editable
});
// Load your project's Routes
keystone.set('routes', require('./routes'));
// Setup common locals for your emails. The following are required by Keystone's
// default email templates, you may remove them if you're using your own.
// Configure the navigation bar in Keystone's Admin UI
keystone.set('nav', {
'posts': ['posts', 'post-categories'],
'enquiries': 'enquiries',
'users': 'users'
});
// Start Keystone to connect to your database and initialise the web server
keystone.start();
Fixed this by making sure all node modules were on the server, pushing to the repo using sourcetree kept timing out, so the modules weren't there. I FTP'd them instead.