Error: Cannot find module 'connect'

后端 未结 8 1824
孤街浪徒
孤街浪徒 2021-02-19 21:27

It appears that this simple app can\'t find the \'connect\' module after I just installed it in the file directory.

var connect = require (\'connec         


        
8条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-19 21:57

    I had the same problem. Node installed into the directory C:\Program Files (x86)\nodejs. Initially I was trying to install and run javascript files from this directory, which caused numerous permissions problems.

    If you've put your server in that directory, try moving it to another directory (perhaps in Documents), navigate there in your Node command prompt, and try running again.

    That worked out-of-the-box for me.

提交回复
热议问题