Skip to content

Latest commit

 

History

History
83 lines (57 loc) · 2.32 KB

faq.md

File metadata and controls

83 lines (57 loc) · 2.32 KB

FAQ

Feel free to add your FAQs. You can add it by making Pull Request to the https://github.com/Cezerin2/cezerin2.github.io

CORS (Allow-Cross-Origin) Error. How to fix?!

You need to change all configs and replace all localhost with your ip number or domain name.

How it's work.

Check file: /cezerin2/src/index.js This code:

// CORS headers
var allowedOrigins = security.getAccessControlAllowOrigin()
var origin = req.headers.origin
if (allowedOrigins === "*") {
  res.setHeader("Access-Control-Allow-Origin", allowedOrigins)
} else {
  if (allowedOrigins.indexOf(origin) > -1) {
    res.setHeader("Access-Control-Allow-Origin", origin)
  }
}

And this file: /cezerin2/src/lib/security.js

const getAccessControlAllowOrigin = () => {
  return [settings.storeBaseUrl, settings.adminBaseURL] || "*"
}

storeBaseUrl and adminBaseURL settings located in your config /cezerin2/config/server.js

Can't build cezerin2-store app, how to fix?

Try to install node-sass before cezerin2-store dependencies.

sudo npm i --unsafe-perm node-sass

Then download cezerin2-store and try to install:

npm i && npm run build

Can't build cezerin2 app (api) on ubuntu, how to fix?

If you have this error:

Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/root/cezerin2/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/root/cezerin2/node_modules/bcrypt/lib/binding --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Possible problem in bcrypt dependency.

Try to install cezerin2 app like this:

npm install --save bcrypt
npm audit fix

"npm run build" command returns "Error 137", how to fix?

Increase RAM size (free memory) on your machine.

You can see free memory by this console command:

free - m

Feel free to add your FAQs.

You can add it by making Pull Request to the https://github.com/Cezerin2/cezerin2.github.io