This problem occurs because of the following scenario: you use Node, for example, version 5. You add several libraries to your project, create and run them. All your libraries will be compiled in Node version 5.
And then you upgrade your Node, for example, to version 6. And then you run some commands that use node, for example npm run test . The problem here is: you are using a newer version of Node to run libraries compiled by older node.
The solution to this problem is performed by the following two commands:
rm -rf node_modules // force remove node_modules directory npm install // install again all libraries.
hqt Oct 17 '16 at 19:41 2016-10-17 19:41
source share