0

Currently working through some of the documentation examples from Jack Henry and I've ran into an issue on the Authentication (Node.js) example project (https://jackhenry.dev/open-api-docs/consumer-api/quickstarts/authentication/)

For reference, here is the git repository being used https://github.com/Banno/consumer-api-openid-connect-example

I have Node.js/npm installed locally and after using "npm install", when I try to use "npm start", I get an error. Screenshot of Error

> @banno/consumer-api-openid-connect-example@1.0.0 start
> ENVIRONMENT='local' node server.js
>'ENVIRONMENT' is not recognized as an internal or external command, 
>operable program or batch file.

I've not modified any of the package.json file where this line is located, which is throwing the error.

Any suggestions as to what could be the issue? Thanks!

Jordanw6
  • 1
  • 1
  • 1
    The `npm start` command is intended to run `node server.js` with the environment variable `ENVIRONMENT` set to `'local'`, but this syntax is unavailable on Windows. This might be helpful to work around that: https://superuser.com/questions/223104/setting-and-using-variable-within-same-command-line-in-windows-cmd-exe – user15517071 Dec 15 '22 at 21:31
  • 1
    [crossenv](https://github.com/kentcdodds/cross-env) is another popular option – username_jj Dec 16 '22 at 05:09

1 Answers1

0

The Node.js examples more or less assume a *nix-compatible operating environment (e.g. Linux, Unix, macOS) and apparently do not work on vanilla Windows.

The suggestions above from other folks for working around how to set up the command line variable or using cross-env might be good to try.

It might also be worth considering using Windows Subsystem for Linux to get that *nix-compatible operating environment.

Jaime Lopez Jr.
  • 476
  • 1
  • 3
  • 9