Coder Social home page Coder Social logo

not able to install module bcrypt about atlas HOT 11 CLOSED

yoonic avatar yoonic commented on August 16, 2024
not able to install module bcrypt

from atlas.

Comments (11)

nash90 avatar nash90 commented on August 16, 2024 2

@andreftavares Thank you very much for your response. I was able to run it after installing bcrypt manually. I also had to install sass manually
npm install [email protected]
npm install [email protected]

now i am trying to run atlas locally but getting some cross origin related issue.
Again thanks for this wonderful project and sharing your knowledge.

from atlas.

andrecrt avatar andrecrt commented on August 16, 2024

Hi,

First of all thanks for your support! Looking forward to hear your thoughts after you get it working :)

I see from the log you posted above that you're running node v6.4.0 and npm v3.10.3. Can you try with node v4.x LTS? (I have it running in node.js v4.2.5 and npm v.3.5.3)

You can use something like https://github.com/creationix/nvm to switch between node.js versions.

Hope it helps! Looking forward to your feedback.

from atlas.

andrecrt avatar andrecrt commented on August 16, 2024

@nash90 any luck? :)

from atlas.

andrecrt avatar andrecrt commented on August 16, 2024

@nash90 thanks for your answer! Will test those versions and perhaps update the requirements.

In regards to the "cross origin" issue, can you provide more details?

from atlas.

nash90 avatar nash90 commented on August 16, 2024

@andreftavares
The actual issue occurred when I was using atlas and nicistore simultaneously locally. nicistore failed to call apis in atlas.
The javascript console log for nicistore app is attached.
The error message is
"XMLHttpRequest cannot load http://localhost:8000/api/v1/account. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 404."

In my understanding as nicistore is hosted in localhost:3000 domain and api is in localhost:8000 domain, when nicistore calls the atlas api there is "No access-control-allow-origin header is present in the resource" issue.

I was wondering how you solve above issue.
Regards,

screen shot 2016-09-05 at 11 56 14 pm

from atlas.

andrecrt avatar andrecrt commented on August 16, 2024

@nash90 did you try running your local Storefront (nicistore) first against the Live Nicistore API and then switching to your local install of Atlas?

Because, from what I can tell, your local install of the Storefront is looking for the API base URL in http://localhost:8000/api/v1. If you're running the default development settings of Atlas, it is exposing the API in base URL http://localhost:8000/v1 (notice the lack of "/api" prefix) <-- Change the settings in the Storefront for this value instead (link)

In the production site nicistore.com, since I'm running both apps (storefront and backend) under the same domain, I opted by mounting the API in the prefix "/api" of the domain, thus the base URL being "https://nicistore.com/api/v1" (link)

Hope this helps!

from atlas.

andrecrt avatar andrecrt commented on August 16, 2024

I've updated nicistore's readme to better explain this scenario (link) please tell me if you think it more clear :)

from atlas.

nash90 avatar nash90 commented on August 16, 2024

@andreftavares After I changed the API base URL to http://localhost:8000/v1, it worked. Thank you so much.
However, I didnt understand the reason of access-control-allow-origin error for earlier case.

I noticed that the response has following header this time when it worked which I think was not present in earlier case.
access-control-allow-origin:http://localhost:3000

Does that mean the api is specially set to add above header in response for all requests. It would really help me to study this behaviour if could give me link to that portion of code.

from atlas.

nash90 avatar nash90 commented on August 16, 2024

@andreftavares By the way, thanks for updating readme. Its very clear now.

from atlas.

andrecrt avatar andrecrt commented on August 16, 2024

@nash90 if you look closely, the issue is that the URL (http://localhost:8000/api/v1) simply does not exist and the API is returning a 404 Not Found :) I'm guessing that Hapi.js simply does not return CORS headers in the case of unexisting routes, thus the CORS message.

Indeed it can lead to misunderstandings... I got used to it, never did much research on the matter!

In Atlas, I configure Hapijs's CORS here https://github.com/yoonic/atlas/blob/master/src/server.js#L32-L35 and you can dig a little further in Hapij's documentation here http://hapijs.com/api

from atlas.

nash90 avatar nash90 commented on August 16, 2024

@andreftavares Thanks for the info.

from atlas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.