Skip to main content
Solved

cognitedata / cognite-sdk-js


Forum|alt.badge.img+6

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: []
}

Best answer by Dilini Fernando

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

View original
Did this topic help you find an answer to your question?

9 replies

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?


Forum|alt.badge.img+6
  • Author
  • Committed
  • 2 replies
  • March 8, 2023

node --version                                                                                              9 ↵
v16.19.1

npm --version                                                                                                 ✔
8.19.3

OS MAC ventura 13.2.1 M1


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
Seasoned Practitioner
Forum|alt.badge.img+1
  • Head of Academy and Community
  • 586 replies
  • March 28, 2023

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


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
Seasoned Practitioner
Forum|alt.badge.img+2

Hi @kevinpeng,

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

Br,
Dilini


Forum|alt.badge.img+6
  • Author
  • Committed
  • 2 replies
  • April 11, 2023

 

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


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
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • 670 replies
  • Answer
  • May 4, 2023

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


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings