简体   繁体   English

上载到heroku时找不到模块“ promise”

[英]Cannot find module 'promise' when uploading to heroku

Everything works fine normally on my local server but when I upload to Heroku, I get the following error. 在本地服务器上一切正常,但是当我上传到Heroku时,出现以下错误。 Wondering if anyone knows how to fix? 想知道是否有人知道如何解决? I am running an angular front end with a Flask back end. 我正在运行一个带有Flask后端的有角前端。 Feel free to let me know what info is useful if you need more. 如果您需要更多信息,请随时告诉我。

Error: Cannot find module 'promise'
2015-01-29T02:13:31.947779+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
2015-01-29T02:13:31.947768+00:00 app[web.1]:     at Function.Module._load (module.js:280:25)
2015-01-29T02:13:31.947781+00:00 app[web.1]:     at Module.require (module.js:362:17)
2015-01-29T02:13:31.947770+00:00 app[web.1]:     at Module.require (module.js:362:17)
2015-01-29T02:13:32.057385+00:00 app[web.1]: 9Z9Z12
2015-01-29T02:13:31.945462+00:00 app[web.1]:           ^
2015-01-29T02:13:31.947766+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:338:15)
2015-01-29T02:13:31.942359+00:00 app[web.1]: module.js:340

It turns out bower for angular sets up files in a place that is not expected by Heroku and therefore you have to move the Bower stuff to a different area (namely in this case for Flask from the main folder to the static folder. 事实证明,Heroku不会在某个地方设置角度设置文件的Bower,因此您必须将Bower内容移动到其他区域(即,在这种情况下,将Flask从主文件夹移动到静态文件夹)。

Hope this helps some other people. 希望这对其他人有所帮助。

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

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