简体   繁体   中英

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. Wondering if anyone knows how to fix? I am running an angular front end with a Flask back end. 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.

Hope this helps some other people.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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