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

后端 未结 7 1840
囚心锁ツ
囚心锁ツ 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:17

    I had this problem, Seems though we use -g it's ignored.

    I just copied contents of MyProject/source/vendor to C:\Users\username\AppData\Roaming\npm

    Copy only needed folders inside node_modules (like: express, express-generator, bower, yo, gulp and packages that should be in PATH).


    This problem really bothers everyone (or windows users?), npm programmers should solve it!

提交回复
热议问题