Getting error, Error: Cannot find module ‘express’ after npm install

后端 未结 7 1803
囚心锁ツ
囚心锁ツ 2020-12-23 20:52

I am new to both Node JS and express, and I have just installed npm in Windows 7.

I have installed express using the global flag:

npm install -g expr         


        
7条回答
  •  一整个雨季
    2020-12-23 21:18

    npm link express to link express from any directory to your project directory were node is, by default when you run npm install express it would be installed in C:\Users\****\AppData\Roaming\npm\node_modules\express, so you don't have to install express and other frameworks required to install each time in your project directory, instead you can point to your node i.e where you have your application.

提交回复
热议问题