node.js, Error: Cannot find module 'express'

后端 未结 18 1872
情话喂你
情话喂你 2020-12-02 08:57

I am new to Node.js, try to learn express to build my first web application. I got stuck on my very first sample code and need some help to get it running. Before I post th

18条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-02 09:22

    In rare cases, npm cache may get corrupt. For me, what worked was:

    npm cache clean --force
    

    Generally, the package manager will detect corruption and refetch on its own so this is not usually necessary. However, in my case Windows 10 crashed a few times and I suspect this may have been during a fetch operation. Hope it helps someone!

    More information: https://docs.npmjs.com/cli/cache

提交回复
热议问题