Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order-Ahead Sample Application #211

Open
michael-hilland opened this issue Nov 28, 2020 · 4 comments
Open

Order-Ahead Sample Application #211

michael-hilland opened this issue Nov 28, 2020 · 4 comments

Comments

@michael-hilland
Copy link

Hi,

I am testing out the order ahead sample application and have already hit a problem.

On testing your credentials, I run the following command:

npm test
However I get the following arror. I have tried troubleshooting but hitting a wall. Any help is greatly appreciated.

`C:\Users\Michael Hilland>npm run seed
npm ERR! missing script: seed

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Michael Hilland\AppData\Roaming\npm-cache_logs\2020-11-28T17_29_04_639Z-debug.log`

@StephenJosey
Copy link
Contributor

Are you getting the error when running npm test or npm run seed? Both of them exist here: https://github.com/square/connect-api-examples/blob/master/connect-examples/v2/node_orders-payments/package.json#L8, unless you've changed something in this file.

@michael-hilland
Copy link
Author

Morning,
I have resolved by using the following:

npm install -g win-node-env

However, I am now still hitting a wall as I am getting the following error when running Localhost:3000

Response status code was not ok: 401.
[
{
"category": "AUTHENTICATION_ERROR",
"code": "UNAUTHORIZED",
"detail": "The Authorization http header of your request was malformed. The header value is expected to be of the format "Bearer TOKEN" (without quotation marks), where TOKEN is to be replaced with your access token (e.g. "Bearer ABC123def456GHI789jkl0"). For more information, see https://developer.squareup.com/docs/build-basics/using-rest-api#set-the-headers. If you are seeing this error message while using one of our officially supported SDKs, please report this to [email protected]."
}
]

I have replaced my access token on the developer portal and still getting the same error.

@michael-hilland
Copy link
Author

I am getting the error when running npm test

@StephenJosey
Copy link
Contributor

The UNAUTHORIZED error means either you're using an invalid access token or it has expired. If you're using sandbox, please make sure to copy from the sandbox credentials in your dashboard and not your production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants