Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running node getting SyntaxError: Unexpected identifier #8

Closed
marklovett opened this issue Mar 9, 2018 · 7 comments
Closed

Running node getting SyntaxError: Unexpected identifier #8

marklovett opened this issue Mar 9, 2018 · 7 comments

Comments

@marklovett
Copy link

When I run node main.js, at 8:30 in the video, at the first console log, I get the below Syntax error.

I created a plugin in my wordpress installation called my-blockchain, put your savjeecoin code in my-blockchain/js/main.js and called the main.js file in my plugin php file: require 'js/main.js';

Help!

Marks-MacBook-Pro:js marklovett$ npm -v
5.6.0
Marks-MacBook-Pro:js marklovett$ node -v
v8.10.0
Marks-MacBook-Pro:js marklovett$ npm outdated
Package Current Wanted Latest Location
crypto-js 3.1.8 3.1.8 3.1.9-1
Marks-MacBook-Pro:js marklovett$ node main.js
/Users/marklovett/test-project/wordpress/wp-content/plugins/my-blockchain/js/main.js:65
let savjeeCoin = new Blockchain();
^^^^^^^^^^

SyntaxError: Unexpected identifier
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 Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3

@Savjee
Copy link
Owner

Savjee commented Mar 12, 2018

Hmm that's weird. Did you change anything in the main.js file?

@marklovett
Copy link
Author

marklovett commented Mar 12, 2018 via email

@Savjee
Copy link
Owner

Savjee commented Mar 13, 2018

I can't help you without taking a look at your actual modifications.
Just copy-paste it into GitHub ;)

@marklovett
Copy link
Author

marklovett commented Mar 13, 2018 via email

@marklovett
Copy link
Author

Xavier,

Here's a link to my gist with the main.js and my plugin php file.

https://gist.github.com/marklovett/acab5e5408c7b200acdd768553b5a0c2

Thanks,
Mark

@Savjee
Copy link
Owner

Savjee commented Mar 14, 2018

You commented out the curly brace } on line 61: https://gist.github.com/marklovett/acab5e5408c7b200acdd768553b5a0c2#file-main-js-L61

That's causing the issue ;)

Because this isn't really a bug I'm closing this issue. You can however keep adding comments & I can still respond. Hope it helps!

@Savjee Savjee closed this as completed Mar 14, 2018
@marklovett
Copy link
Author

marklovett commented Mar 14, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants