问题描述:    

使用nmp install express -g命令全局安装express后,在终端使用express -V命令可以获取到express的版本号,但在引用express的项目运行时,会报缺少express的错误,如下图


MacOS下Express安装过程中遇到的问题

 

解决方案:

在配置文件/etc/profile中添加Node的路径

 

export NODE_PATH="/usr/local/lib/node_modules"

 

 重新运行/etc/profile

source /etc/profile 

  重启终端,既可正常使用express

MacOS下Express安装过程中遇到的问题

 

相关文章:

  • 2021-12-31
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-22
  • 2021-08-17
  • 2021-10-03
  • 2021-10-26
  • 2022-01-04
  • 2022-01-16
相关资源
相似解决方案