[Vuejs]-Travis-cli build errors but local tests/build is OK

0👍

You’re running version 8.4.0 locally, but Travis runs 4.8.0, because that’s what you’ve configured in your .travis.yml. The unexpected { is likely some object destructuring, which was first supported in Node version 6. From the logs I presume that some code in a webpack loader is using it, which means that they do not intend to keep supporting older versions of Node.

You should use a newer version of Node for Travis as well, especially since version 4 is no longer actively maintained, which means that only critical fixes are applied, until it reaches the end of life (for details see Release schedule). Travis should represent the environments you’re targeting / plan to run it on.

Regarding the module not found errors, you’re using underscore (e.g. in VueNoiseGeneratorPlugin.js), but it’s not in your package.json. That means it never gets installed and the only reason that it works locally is that you have installed it without saving it (before npm 5 --save is required to actually add it to the package.json) or you have installed it outside the project, which is still picked up by Node (for instance globally installed). You have to add it to the package.json.

npm install --save underscore

And lastly, you’re using babel-plugin-transform-runtime, which requires babel-runtime to be installed as a dependency. Based on the environment you’re targeting, you don’t need babel-plugin-transform-runtime, so you could remove it entirely. If you still want to use it, you need to install babel-runtime.

npm install --save babel-runtime

0👍

I just dealt with this issue for 2 hours 🙁 My problem was that the github repo file names had a different case (lower or uppercase) than my local files. Once I matched my local files to what was on github the errors went away.

Leave a comment