错误:找不到模块"./shared" [英] Error: Cannot find module './shared'

查看:104
本文介绍了错误:找不到模块"./shared"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让MongoLab在Heroku上运行一个Node应用程序.我在Heroku日志中收到以下消息:错误:找不到模块'./shared'".我已经多次卸载并重新安装了node_modules,并且还安装了共享"模块,但无济于事.该应用程序可以在本地主机上正常运行.我有什么想念的吗?

I am attempting to get a Node app with MongoLab working on Heroku. I get the following message in my Heroku logs: "Error: Cannot find module './shared'". I have uninstalled and reinstalled node_modules several times and have also installed a "shared" module, to no avail. The app runs fine on localhost. Is there anything I'm missing?

推荐答案

只是遇到了同样的问题.似乎您使用的是最新节点v6.0.0. 请检查您是否在Heroku上使用最新的npm.

Just got the same issue. Seems you use latest node v6.0.0. Please check you use the latest npm on Heroku.

在package.json中检查以下内容: ... 引擎": { "node":"6.0.0", "npm":"3.8.7" }, ...

Check the following in your package.json: ... "engines": { "node": "6.0.0", "npm": "3.8.7" }, ...

这篇关于错误:找不到模块"./shared"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆