Nodejs Cannot find module

前端 未结 5 483
南旧
南旧 2020-12-30 00:40

I\'m getting an error when trying to use any global module, exemple:

Error: Cannot find module \'express\'
    at Function.Module._resolveFilename (module.js:         


        
5条回答
  •  情书的邮戳
    2020-12-30 00:57

    Just to quote from here:

    https://www.npmjs.org/doc/files/npm-folders.html

    • Install it locally if you're going to require() it.
    • Install it globally if you're going to run it on the command line.
    • If you need both, then install it in both places, or use npm link.

提交回复
热议问题