0

I am trying to implement some axios projects(beginer level) and i get this reference errror that require is not defined? I have already inserted it using

npm install axios require

SCREENSHOOT

Any ideas what might failed?

I have also created a post with additional issues i dealed with inserting axios here!

Evan
  • 583
  • 1
  • 5
  • 11
  • Anything could fail. I'm positive you don't need to install `require`. Why is the question labeled with RequireJS? If you use it with Node, this is a mistake. The problem depends on your Webpack configuration and other build details which aren't presented in the question. You don't need to use `require()` in an app that is bundled with Webpack, use `import` instead. Webpack config file name has a typo. – Estus Flask Oct 25 '18 at 19:39
  • so requirejs is not relevant with my problem? Is webpack neccesary for require and import to work? And if so do i need babel? Since import is an ES6 module? – Evan Oct 25 '18 at 19:41
  • No, it is not relevant. – Estus Flask Oct 25 '18 at 19:43
  • Check this: https://stackoverflow.com/questions/23603514/javascript-require-function-giving-referenceerror-require-is-not-defined – martino Oct 25 '18 at 19:49

0 Answers0