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

SyntaxError: Unexpected identifier #42

Open
sheksushant opened this issue Sep 3, 2018 · 10 comments
Open

SyntaxError: Unexpected identifier #42

sheksushant opened this issue Sep 3, 2018 · 10 comments

Comments

@sheksushant
Copy link

/Users/sushant/Desktop/summarize/node_modules/node-summary/lib/summary.js:1
(function (exports, require, module, __filename, __dirname) { import _ from 'lodash'
^

SyntaxError: Unexpected identifier

fix for this?

@emhagman
Copy link

+1

2 similar comments
@AlexandruSimandi
Copy link

+1

@goalia
Copy link

goalia commented Dec 8, 2018

+1

@guy16510
Copy link

It appears that if you update the summary.js file to use 'require' instead of 'import' it works fine.

@corysimmons
Copy link

@jbrooksuk Seems like the repo's /lib is out of sync with what's on npm.im/node-summary

Bump patch version in package.json then npm publish to fix maybe?

If not, @guy16510 's suggestion works.

@503Dev
Copy link

503Dev commented Apr 4, 2019

To expand on this for anyone still struggling, if you still can't make progress after @corysimmons suggestion then you need to navigate to your projects root folder then -> node_modules -> node-summary -> lib -> summary.js

Replace the first 3 lines with the following:
var _ = require('lodash') var Tokenizer = require('sbd') var request = require('request')

Note: There are other ways to accomplish the same but in essence with the current stable Node release you would want to use require instead of import

@bonesoul
Copy link

bonesoul commented Apr 8, 2019

can we get a fixed release on npm pls?

@hanxue
Copy link

hanxue commented May 9, 2019

Hello @jbrooksuk , would you consider perhaps a minor 1.2.1 release? node-summary does not work when ES6 syntax is used,

const SummaryTool = require('node-summary')

project/node_modules/node-summary/lib/summary.js:1
(function (exports, require, module, __filename, __dirname) { import _ from 'lodash'
                                                                     ^

SyntaxError: Unexpected identifier

@nitish24p
Copy link

Can this fix plz plz be pushed to npm

@sheksushant
Copy link
Author

@jbrooksuk ?

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

10 participants