npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Block scoped Declaration not yet supported outside strict mode for node cache module

What I Wanted to Do

We have a node project where we automated all the unit tests using mocha.We tested all the unit tests on Windows and Linux system but when it comes to Ubuntu tests cases are failing due to below error.
Block scoped Declaration not yet supported outside strict mode which is pointing to node-cache module

All the test cases should pass on Ubuntu system

What Happened Instead

Block scoped Declaration not yet supported outside strict mode.

Reproduction Steps

Use node-cache module in your project and consume that in any one of the unit test.


Platform Info

$ npm --versions
$ node -p process.platform
Ubuntu bionic 18.04 
node --version

Note we tried all the stuffs by changing node version from 10.15.0 to 6.14.x,8.x.x but didn't get any luck.

(You might get an answer here, but because this forum is focused on npm, you might want to ask your question somewhere that targets experts with your package. I have moved your topic to #community:javascript)

#community:javascript could you please have a look into above issue

@shadowspawn Can some one from NPM community look into it, I didn’t receive anything back from #community:javascript

I did some searches and most of the matching reports are about needing to update node, but you are using an LTS version. Is that the version being run when the error occurs, or is something like ts-node or babel being invoked?

You could provide some more explicit reproduce steps, like a repo to clone and a command to run, but it does not look like an npm issue.