Skip to main content
Committed ⭐️⭐️⭐️
Mar 6, 2023 8:23 PM UTC
Solved

cognitedata / cognite-sdk-js

https://github.com/cognitedata/cognite-sdk-js/tree/master/samples/react/msal-browser-react, I am trying to run npm install and $ REACT_APP_CDF_PROJECT=... REACT_APP_AZURE_TENANT_ID=... REACT_APP_AZURE_APP_ID=... npm start

got the following error:

node:internal/modules/cjs/loader:1024
  throw err;
  ^

Error: Cannot find module '/Users/kevin.peng/code/cognite/cognite-sdk-js/samples/react/msal-browser-react/start'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1021:15)
    at Function.Module._load (node:internal/modules/cjs/loader:866:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Dilini Fernando
Expert ⭐️⭐️⭐️⭐️
May 4, 2023 4:29 PM UTC

Hi @kevinpeng,

I hope Baris' response was helpful, and that you were able to resolve the issue.

As of now, I will close this thread. Please let us know if you have any questions.

Best regards,
Dilini

9 replies

Practitioner ⭐️⭐️⭐️
Mar 8, 2023 1:57 PM UTC

Hi,

I’m having trouble replicating this problem. Could you be able to give me more details?
Which OS are you running? What’s your node / npm version?

kevinpengAuthor
Committed ⭐️⭐️⭐️
Mar 8, 2023 3:08 PM UTC

node --version                                                                                              9 ↵
v16.19.1

npm --version                                                                                                 ✔
8.19.3

OS MAC ventura 13.2.1 M1

Practitioner ⭐️⭐️⭐️
Mar 9, 2023 9:48 AM UTC

Thanks for the response. I can now see weird behavior with node v16 around dependencies, and we cannot even install with node v18. I’ll try to update the dependencies there to make it work with both.
Thanks for letting us know! I’ll update here once I have the solution merged.

Anita Hæhre
Expert ⭐️⭐️⭐️⭐️
Head of Community
Mar 28, 2023 1:35 PM UTC

Hi @Baris Demirel checking in to see if the above is resolved? Let us know if you still have issues, 

Anita Hæhre
Practitioner ⭐️⭐️⭐️
Mar 29, 2023 1:09 PM UTC

Hi there, sorry for all this delay. I’ve merged a fix now. If you fetch the latest version, you should be able to use the samples, no problem.
Let me know if you still have any issues!

Dilini Fernando
Expert ⭐️⭐️⭐️⭐️
Expert ⭐️⭐️⭐️⭐️
Apr 10, 2023 6:15 AM UTC

Hi @kevinpeng,

Were you able to fetch the latest version and try it out?
Let us know if you have any questions. 

Br,
Dilini

kevinpengAuthor
Committed ⭐️⭐️⭐️
Apr 11, 2023 7:05 PM UTC

 

get following error:

 

Module not found: Error: Can't resolve '@cognite/sdk-core' in '/Users/kevin.peng/code/cognite/cognite-sdk-js/samples/react/msal-browser-react/node_modules/@cognite/sdk/dist'

 

node version v19.9.0

npm version 9.6.4

 

mac arm

Practitioner ⭐️⭐️⭐️
Apr 18, 2023 8:47 PM UTC

Hi Kevin,

I’m sorry for the delay in response, I’ve missed it.

You need to run `yarn build` or `npm build` in `Users/kevin.peng/code/cognite/cognite-sdk-js`. And if npm doesn’t work, please try yarn, the repository uses yarn by default.

Dilini Fernando
Expert ⭐️⭐️⭐️⭐️
Expert ⭐️⭐️⭐️⭐️
May 4, 2023 4:29 PM UTC

Hi @kevinpeng,

I hope Baris' response was helpful, and that you were able to resolve the issue.

As of now, I will close this thread. Please let us know if you have any questions.

Best regards,
Dilini