Open sheksushant opened 6 years ago
+1
+1
+1
It appears that if you update the summary.js file to use 'require' instead of 'import' it works fine.
@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.
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
can we get a fixed release on npm pls?
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
Can this fix plz plz be pushed to npm
@jbrooksuk ?
/Users/sushant/Desktop/summarize/nodemodules/node-summary/lib/summary.js:1 (function (exports, require, module, filename, dirname) { import from 'lodash' ^
SyntaxError: Unexpected identifier
fix for this?