Express module not found when installed with NPM

后端 未结 14 1539
庸人自扰
庸人自扰 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:30

    It may happen, if you're using windows, that the environment variable NODE_PATH is not set, and thus when you execute node fileName.js it won't find the libraries.

    Check for the variable on your console, and if not present, create it. Give it the NODE_HOME\node_modules value, where NODE_HOME is your node install dir. This path is where npm install puts every module upon downloading.

    0 讨论(0)
  • 2020-12-22 23:32

    require.paths is removed, use the NODE_PATH environment variable instead.

    0 讨论(0)
提交回复
热议问题