Sh: react-scripts: command not found

Hello everyone,

Sorry to bother you with this. I know you have discussed this many times, but I tried everything I found in the community chat, and it doesn’t work. How can I install the react -script? I’ll be thankful to anyone who can help this beginner stack with the lesson :slight_smile:

Hi, @claudia_giannoni. I’m sure we would be happy to help.

Can you tell us what you have tried and where you are stuck? For example, the Getting Started with Daml page includes a react-backed application. Is that what you are working through? What step are you on? Are you seeing an error message?

Hi, Thank you ever so much!!! I spent all day trying to fix this ( is m sure it’s trivial for you) , and now it looks I progressed a bit as it looks like it finds the npm, but it doesn’t open the page, and it gives me this error:

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED'

I am trying to install the sandbox in DAML

I believe this is a known issue with the latest versions of Node. See for example this thread.

The sample application works with Node.js 14. You can see what version of Node.js you are using with node --version. Presumably you are using a version of Node.js that is more recent than version 14. What to do?

Supporting multiple versions of Node on a single machine has historically been challenging. There are lots of solutions out there.

  • If you have no other reason to have Node.js on your machine, you could uninstall your current version and install Node.js v. 14.
  • If you want to be able to use multiple versions of Node.js on your machine, nvm is a popular solution.

Let us know how it goes.

Hi Wallace, just a quick question, I think I managed to instal the npm, and I don’t get that message any more. Now it when I input npm start it looks that it starts the sandbox but it fails to compile. I get the error below:

Failed to compile.
./src/config.ts 142:46
Module parse failed: Unexpected token (142:46)
You may need an appropriate loader to handle this file type.
| // We default to assuming that user management is enabled so we interpret everything that
| // isn’t explicitly “false” as supporting user management.

process.env.REACT_APP_SUPPORTS_USERMANAGEMENT?.toLowerCase() !== “false” ? withUserManagement : noUserManagement;
| export var authConfig = function () {
| if (isRunningOnHub()) {

Would you still suggest installing Node.js 14? Thank you a lot for answering, I am really exhausted from trials now :slight_smile: :slight_smile:

@claudia_giannoni I have tried everything I can think of to reproduce your error message. I have not found a way to reproduce it.

May I recommend starting from scratch?

  1. Install Node.js, version 14.
  2. In a new folder, daml new create-daml-app --template create-daml-app
  3. cd create-daml-app
  4. daml build
  5. daml start
  6. Open a second terminal window.
  7. cd create-daml-app/ui
  8. node --version (to confirm you are using a v14.21.1)
  9. npm install
  10. npm start

At this point, :crossed_fingers: the browser should open the following:

Does this work for you?

Wallace, you are a STAR!!! Thank you ever so so so much!!! Finally, it works!! I am ever so grateful. Have a wonderful weekend :slight_smile: :slight_smile:

The openssl dependency issue can be also be remedied by changing the line containing the start command in your package.json file, adding the --openssl-legacy-provider node option. On windows you should change it to

"start": "set NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",

on linux or mac the following

"start": "NODE_OPTIONS=--openssl-legacy-provider react-scripts start",

This has been tested and working with the current LTS version of nodejs which is 18.x at the time of writing this reply.

2 Likes

Hi Wallace, here I am again. Would you have another 5 min for me? :slight_smile:

I followed your instructions, and I managed to create the Sandbox. However, when I try to log in as Alice or any name, I get an error saying

" Failed to login as ‘Alice’:
{“status”:401,“errors”:{“User ID"Alice" does not match regex"[a-z0-9@^$.!\-#+'~_|:]{1,128}"”]}.

I know I am a pain! Sorry about this. Would you have another 10 min to help? It would be great !! :pray: :pray: :pray: :pray: :pray: :pray:

Hi, Claudia. Try alice instead of Alice. :slight_smile:

Thank you so much!! It works! Sorry I am following a tutorial, and I didn’t think the Capital letter would matter. But I still cannot make Alice follow Bob, even though I put bob instead of Bob. It says “INAVLID_PARTY_ IDENTIFIER”

Another little bit of help?

I think I tried in any which way. it says:

Unknown error:
{“status”:400, “errors”:
[“INVALID_PARTY_IDENTIFIER(8,94c4d7c1): The given party is not a valid Canton party identifier: unable to parse party: Invalid unique identifier ’ bob’ with missing namespace.”]}.

I tried with other names, but same message.

:pray: :pray: :pray: :pray: :pray: :pray: :pray:

Sorry again, I have been struggling with these for days now… I would love at least to see the end of the tutorial today! :slight_smile: :slight_smile:

Before Alice can follow Bob, Bob must log in. Here is the correct sequence.

  1. Open a browser window. Log in as alice.
  2. Open another browser window. Log in as bob.
  3. Return to the first browser window, select Bob from the drop down list.

I tried just typing in Bob and bob after step 1 and I got the error you saw.

1 Like

Again Wallace, thank you ever so much for your help. Just tried it, and it works. Sorry, this was a bit silly of me; I was so sure I was making some big mess somewhere that I didn’t think about logging in as Bob before, which is understandable. :slight_smile:

I really really appreciate your help. Thank you again for your patience. :pray: :pray: :pray: :pray: :pray: :pray:

1 Like