Express module not found when installed with NPM

后端 未结 14 1546
庸人自扰
庸人自扰 2020-12-22 22:59

When I try to run the app.js file created by express, I get the following error:

$ node app.js

node.js:134
        throw e; // process.nextTick         


        
14条回答
  •  一整个雨季
    2020-12-22 23:21

    I had the same problem. This worked for me though:

    Seems like npm (now?) installs node modules to /usr/local/lib/node_modules/ and not /usr/local/lib/node/

    What I did was simply to copy everything from node_modules to node: sudo cp -r /usr/local/lib/node_modules/* usr/local/lib/node/ and now it seems to be working for me.

    Hope this helps you :-)

提交回复
热议问题