`const isNumber = require('lodash.isfinite')` breaking CI
Closed this issue ยท 12 comments
In circle CI, I'm getting this error on deploying. I can find similar errors all over the results, thinking CI doesn't like ES6.
I don't know may be we need a Circle CI config file? like: https://github.com/ipfs/js-ipfs-api/blob/db5d73156f900a97a9f1323b5cfefd0f4fa49d45/circle.yml
gulp ci-test-sequence
/home/ubuntu/uq-tw-sp-app/node_modules/browser-sync/node_modules/portscanner/node_modules/is-number-like/lib/index.js:2
const isNumber = require('lodash.isfinite')
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/ubuntu/uq-tw-sp-app/node_modules/browser-sync/node_modules/portscanner/lib/portscanner.js:4:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
npm ERR! Test failed. See above for more details.
npm test returned exit code 1](url)gulp ci-test-sequence
/home/ubuntu/uq-tw-sp-app/node_modules/browser-sync/node_modules/portscanner/node_modules/is-number-like/lib/index.js:2
const isNumber = require('lodash.isfinite')
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/ubuntu/uq-tw-sp-app/node_modules/browser-sync/node_modules/portscanner/lib/portscanner.js:4:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
npm ERR! Test failed. See above for more details.
npm test returned exit code 1
I am seeing this same error on a project using this module today as well.
I've solved it by adding node version
to the end of my circle.yml
file. Now it looks like:
#other config
machine:
node:
version: 4.4.5
where 4.4.5
is my current node version which runs tests okay. I don't know this is a real fix or not though. I think the package itself have to solve the issue.
This change should have been in a Major version as it requires a new version of Node.
Is anyone currently working on a fix for this?
ill check it, bit strange since it only uses lodash is finity
ah get it its es6 requires minimum io.js ill add a dependency
hey this should work now use version 1.0.5
I used 1.0.6 while building and still had the same problem. Are you sure it's fixed?
To be precise, it's on index.js:19
const length = val.length
Did you try deleting the node_modules/
and re-installing dependencies?
I did, but see in index.js, they left another const. It's the same error, but not on the same line.
I don't really know how to contribute to this kind of repos, or I would change it myself..
@danielquijada Yes, you are right. You can fix it yourself and help others by contributing to this repo.
https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/