简体   繁体   English

Heroku找不到模块

[英]Heroku can't find module

I'm new with heroku. 我是heroku的新手。 I've being following the tutorial for deploying node on heroku. 我一直在遵循在heroku上部署节点的教程。 In fact, I'm trying to deply total.js eshop on heroku... but I can't solve the following error. 实际上,我正在尝试在heroku上部署total.js eshop ...但是我无法解决以下错误。

2018-10-28T10:08:58.151845+00:00 heroku[web.1]: Starting process with command `node debug.js`
2018-10-28T10:09:00.188338+00:00 app[web.1]: module.js:550
2018-10-28T10:09:00.188370+00:00 app[web.1]: throw err;
2018-10-28T10:09:00.188372+00:00 app[web.1]: ^
2018-10-28T10:09:00.188374+00:00 app[web.1]:
2018-10-28T10:09:00.188376+00:00 app[web.1]: Error: Cannot find module 'node_modules/total.js/debug.js'
2018-10-28T10:09:00.188377+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:548:15)

This is the code from the initial point of access 这是从初始访问点开始的代码

require('node_modules/total.js/debug.js')(options);

I've checked that my folder structure exits, but let me say that I've modified the above code. 我已经检查了我的文件夹结构是否退出,但是可以说我已经修改了上面的代码。

It used to be 它曾经是

require(total.js/debug')(options);

and it worked locally. 它在本地工作。

Could it be this related to the fact that I've installed locally this, but this is not executed in heroku? 这可能与我在本地安装了此文件但在heroku中未执行的事实有关吗?

install $ npm install total.js
install $ npm install paypal-express-checkout

Any suggestion? 有什么建议吗? Thanks 谢谢

Here is older Total.js example for Heroku . 这是Heroku的较旧的Total.js示例 Maybe it solves your problem. 也许它可以解决您的问题。

Sounds like a pathfile problem. 听起来像是路径文件问题。 Try removing the /node_modules from your "require", or do it with a relative path ie: 尝试从您的“需求”中删除/ node_modules,或使用相对路径(即:

"./node_modules/total.js"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM