Error: Cannot find module 'connect'

后端 未结 8 1812
孤街浪徒
孤街浪徒 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 22:05

    Express internally uses Connect as one of its node_modules dependencies.

    If you wish to use Connect in your app, you'll need to add it to your package.json and run npm update.

    By design, each node module has its own private internal dependencies.

    If you want to use any, your app will need to install them too.

    It means your app can use a different version of the modules, and each module can internally use different versions again without conflicts.

提交回复
热议问题