Error: Cannot find module 'cors'

后端 未结 4 1463
无人及你
无人及你 2021-02-19 00:07

I keep getting this error message below: I tried to find other stackoverflow post and articles but couldn\'t really sovle it. do any of you guys know what the problem is it?

4条回答
  •  悲哀的现实
    2021-02-19 00:47

    Run npm install cors --save from the command line in the main project directory to install it and add it to your package.json

    It is possible that the cors module was separated from the main express package a long time ago, and the code you are using was written before that. (Or never was a part of it, to begin with)

提交回复
热议问题