Hyperledger Fabric Fabcar node enrollAdmin.js - ubuntu-16.04

I'm trying to run fabcar sample. But at the step of run a command which is node enrollAdmin.js an error occurs like below;
/home/<username>/fabric-samples/fabcar/node_modules/fabric-client/lib/Client.js:742
async _createOrUpdateChannel(request, have_envelope) {
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/<username>/fabric-samples/fabcar/node_modules/fabric-client/index.js:25:18)
I have checked the file which is error occurred. I find line 742 but I couldn't see syntax error.

Had the same error, it works after i updated to Node v8.9.4.
npm rebuild and run

It is stated in the Hyperleder fabric Pre-Requisites that the only node version 8.9.X is supported. https://hyperledger-fabric.readthedocs.io/en/release-1.2/prereqs.html
Would advise you to upgrade the node version. Use this link to upgrade the node version: Upgrading Node.js to latest version

Related

How can I fix Heroku Application Error caused by configuration property?

I have a small project that used to work on Heroku. However, after some minor changes, I get an Application Error.
When I type npm start on the Heroku console, it gives me the following error
/app/node_modules/config/lib/config.js:182
throw new Error('Configuration property "' + property + '" is not defined');
^Error: Configuration property "mongoURI" is not defined
at Config.get (/app/node_modules/config/lib/config.js:182:11)
at Object.<anonymous> (/app/server.js:12:19)
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 Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
I have tried to add config vars manually on Heroku but didn't help. I am not sure what's not working because everything is fine when I run it on the localhost, and I have not changed anything on the server-side. Is there any solution for this?

Loopback cli (lb4) crashing on launch

After installing lb4 cli (npm i -g #loopback/cli), I'm unable to launch lb4 from the command line (Ubuntu 18.04). I get the following error:
/usr/local/lib/node_modules/#loopback/cli/node_modules/fs-extra/lib/mkdirs/make-dir.js:85
} catch {
^
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/#loopback/cli/node_modules/fs-extra/lib/mkdirs/index.js:3:44)
Thanks in advance for any help on how this could be resolved.
The most likely culprit is that you are using Node.js version 8, which does not support optional catch binding (a part of ES2017, see https://github.com/tc39/proposal-optional-catch-binding).
LoopBack requires Node.js version 10 or newer to run. Please upgrade your Node.js version to 10.x or newer.

Can't host Discord Bot on Raspberry Pi

I did everything in the tutorial(https://www.youtube.com/watch?time_continue=758&v=kpci6V8969g). When I run the pm2 command, the bot doesn't work.
When I try the node index.js command, it displays me this error:
async setProvider(provider) {
^^^^^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous>
That tutorial may not have been what you needed. From my experience, all you have to do is install node.js and Node Package Manager or NPM for short. Both of these I use exclusively. A quick google search can bring you many tutorials on youtube and on various other tech websites that are sure to help. I hope this helps
Wishing you luck,
Zaedus

SyntaxError: Unexpected token [ - ionic

I'm trying to start off my first ionic app; getting 'SyntaxError: Unexpected token [' on every ionic commands. Literally all ionic commands returning the same output.
$ ionic start test --v2
/Users/user/.nvm/versions/node/v4.1.1/lib/node_modules/ionic/dist/index.js:24
const [xcode, iosDeploy, iosSim,] = yield Promise.all([
^
SyntaxError: Unexpected token [
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
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> (/Users/user/.nvm/versions/node/v4.1.1/lib/node_modules/ionic/bin/ionic:8:11)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
NPM: 4.5.0
OS: OSX Sierra
The solution is not to downgrade as suggested by the previously accepted answer, but to upgrade Node as suggested in this answer.
Ionic needs to run on Node > 6.
So I was solving it upgrading Node on my Mac using Brew like:
brew upgrade node
brew link --overwrite node
First one was upgrading Node. The second one was needed to overwrite other Node binaries I had.
Using Node 7 I was able to execute the ionic command.

can not run meteor bundle in node on CENTOS

I have a meteor app that works fine on my computer under OSX but when I copy it to my CENTOS 6 server it gives me following error:
node main.js
server/server.js:95
Fiber(function () {
^
ReferenceError: Fiber is not defined
at run (/root/bundle/server/server.js:95:3)
at Object.<anonymous> (/root/bundle/server/server.js:156:1)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/root/bundle/main.js:1:63)
at Module._compile (module.js:449:26)
I did install the fibers package with npm install fibers
I also changed the port number in server.js to be 8282 instead of 80 in order to avoid any conflicts.
thank you for your help
it turns out you have to install fibers inside the meteor project and not as a global package