Why can't I use cdk on wsl2? - python-3.x

I installed cdk on wsl2 and I try to use it but I get this error:
(manifest,filePath,ASSETS_SCHEMA,Manifest.patchStackTagsOnRead)}static loadAssetManifest(filePath){return this.loadManifest(filePath,ASSETS_SCHEMA)}static saveIntegManifest(manifest,filePath){Manifest.saveManifest(manifest,filePath,INTEG_SCHEMA)}static loadIntegManifest(filePath){return this.loadManifest(filePath,INTEG_SCHEMA)}static version(){return SCHEMA_VERSION}static save(manifest,filePath){return this.saveAssemblyManifest(manifest,filePath)}static load(filePath){return this.loadAssemblyManifest(filePath)}static validate(manifest,schema4,options){function parseVersion(version){const ver=semver.valid(version);if(!ver){throw new Error(`Invalid semver string: "${version}"`)}return ver}const maxSupported=parseVersion(Manifest.version());const actual=parseVersion(manifest.version);if(semver.gt(actual,maxSupported)&&!(options==null?void 0:options.skipVersionCheck)){throw new Error(`${VERSION_MISMATCH}: Maximum schema version supported is ${maxSupported}, but found ${actual}`)}const validator=new jsonschema.Validator;const result=validator.validate(manifest,schema4,{nestedErrors:true,allowUnknownAttributes:false});let errors=result.errors;if(options==null?void 0:options.skipEnumCheck){errors=stripEnumErrors(errors)}if(errors.length>0){throw new Error(`Invalid assembly manifest:
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> (/usr/local/lib/node_modules/aws-cdk/bin/cdk.js:3:15)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
I've tried reinstalling it, updating it, but I didn't succeed. I also searched on stack overflow but I didn't find anything to help me.

This was a problem in Node v12. Upgrading the version to v14 or higher should solve the problem.

Related

nodemon or nodemon index.js not working on ubuntu 16.04

I am trying to run my server automatically after every push, do not want to restart every time on ubuntu instance 16.04
/usr/local/lib/node_modules/nodemon/lib/monitor/run.js:356
let sig = signal.replace('SIG', '');
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/nodemon/lib/monitor/index.js:2:8)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
having this error, can anyone tell what is the problem?
Thanks budy #developerKumar and sorry for late reply.
you gave me a hint I simply upgrade my node version and its working.

NodeJS Error In Constructor Language Only Present On Ubuntu

I am trying to get a particular npm package to run on Ubuntu 16.04. I am currently running the most up-to-date versions of nodejs and npm, as well as the package (turndown).
Here is the error that I get:
root#ubuntu-s-1vcpu-1gb-nyc1-01:/usr/server# nodejs index.js
/usr/server/node_modules/jsdom/lib/api.js:10
const { URL } = require("whatwg-url");
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at createHTMLParser (/usr/server/node_modules/turndown/lib/turndown.cjs.js:529:17)
at Object.<anonymous> (/usr/server/node_modules/turndown/lib/turndown.cjs.js:537:60)
at Module._compile (module.js:410:26)
The error states it occurs within the "turndown" package and is due to the language in the constructor. What is confusing to me is that this runs on Fedora 27 without error.
What could be causing the difference in behavior?
The answer to this question was to update my version of NodeJS. I ran into another error now, but it is package related.

throw new TypeError('The super constructor to "inherits" must not ' +

I am trying to build my nodejs application. but i am always getting this error.
util.js:988
throw new TypeError('The super constructor to "inherits" must not ' +
^
TypeError: The super constructor to "inherits" must not be null or undefined
at Object.inherits (util.js:988:11)
at Object.<anonymous> (D:\CIDE-Backend\CIDE-BACKEND\node_modules\zetta\node_modules\spdy\lib\spdy\connection.js:86:6)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (D:\CIDE-Backend\CIDE-BACKEND\node_modules\zetta\node_modules\spdy\lib\spdy.js:20:19)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
[nodemon] app crashed - waiting for file changes before starting...
i followed this solution but still i am getting same error.
my node version is 8.4.0
my npm version is 5.5.1
Can you tell me how can i solve this error.?
Your dependency zetta is including an ancient version of spdy which is not compatible with you current version of Node. There is currently an open issue on zetta's github about this, which has a work around:
process.EventEmitter = require('events').EventEmitter
const zetta = require('zetta')
Your mileage may vary on that hack, I have not tested it myself. Alternatively, you could wait for the zetta team to fix their dependency or downgrade your node installation.

Installation problems with CodeceptJS on Ubuntu

I was settings up a new system to use CodeceptJS and have hit an issue. I followed these notes, but just get an error when trying to run codeceptjs. The error is...
codeceptjs
/usr/local/lib/node_modules/codeceptjs-webdriverio/node_modules/codeceptjs/lib/mocha_factory.js:6
let mocha;
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
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> (/usr/local/lib/node_modules/codeceptjs-webdriverio/node_modules/codeceptjs/lib/container.js:5:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
My node.js and npm is installed globally via normal apt-get and npm -g
System info...
Ubuntu 17.04 x86_64
nodejs: 4.7.2
npm: 4.5.0
bash 4.4.5
Does anyone know the cause of this issue or how to get around it?
Just as an update, thanks to artem for the note on 'use strict'; I added that to the top of node_modules/codeceptjs/lib/mocha_factory.js and that, I think, got me past the initial problem. However I now seem to be hitting an issue in node_modules/codeceptjs/lib/output.js. The error is...
codeceptjs
/usr/local/lib/node_modules/codeceptjs-nightmare/node_modules/codeceptjs/lib/output.js:139
function print(...msg) {
^^^
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> (/usr/local/lib/node_modules/codeceptjs-nightmare/node_modules/codeceptjs/lib/event.js:3:11)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
...I've tried a few things to resolve this, adjusting the print function there, but with no luck yet.
This seems to be the same with the codeceptjs-nightmare and codeceptjs-webdriverio meta-packages.
I'd be grateful of any ideas, suggestions or alternatives anyone has.
Your second issue is because of an outdated Node version. The spread operator (the ... error that you're seeing) is supported in Node 5.12.0 and later: http://node.green/#ES2015-syntax-spread-------operator
I'm not sure what the best way for you to upgrade is with Ubuntu, but that should solve your issue.

Node.js SteamBot not working

my Node.js Steam-Bot isnt working. When i try starting him it always gives a Syntax Error:
/root/bot/node_modules/steam-tradeoffer-manager/lib/index.js:3
const SteamCommunity = require('steamcommunity');
^^^^^
SyntaxError: Use of const in strict mode.
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> (/root/bot/tradebot.js:20:25)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
Iam using Debian 8, Node Version 0.12.
Thank you!
The error says it all. Replace const with var.
Also, you should update your nodeJS version as mentioned in the comments. This is really important.

Resources