Order-Ahead Sample Application
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`
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.
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
Authorizationhttp 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.
I am getting the error when running npm test
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.