Topic: npm install is giving me an error that I have no access to the gitlab React Pro repository

Sandesh Athreya free asked 4 years ago


Expected behavior After renewing React Pro subscription, Git lab access should be available to the React Repository

Actual behavior npm install throws an error that git lab repository not found

Resources (screenshots, code snippets etc.)


Mateusz Leciejewski staff commented 4 years ago

Dear @Sandesh Athreya,

react repositories are available on your account. Do you still have problems with its availability?

Best regards, Mateusz


mark-steven-au premium answered 4 years ago


Now for the dependants Going by the https://mdbootstrap.com/docs/react/getting-started/quick-start/ guide all I need to do is again adjust the package.json file line 6 and add "dependencies": { "mdbreact": "git+https://oauth2:YOUR_TOKEN_GOES_HERE@git.mdbootstrap.com/mdb/react/re-pro.git" } put token in where it says YOUR_TOKEN_GOES_HERE save and then run npm install again.

I then get failure JSON.parse Failed to parse json npm ERR! JSON.parse Unexpected string in JSON at position 401 while parsing '{ npm ERR! JSON.parse "name": "your-app", npm ERR! JSON.parse "version": "0.' npm ERR! JSON.parse Failed to parse package.json data. npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

Remove the dependancies line in packages.json and npm install works fine again

same if I use npm install git+https://oauth2:TOEK_IN_HERE@git.mdbootstrap.com/mdb/react/re-pro.git --save

SO any ideas out there?


Piotr Glejzer staff commented 4 years ago

can you copy and paste your whole package.json file?


mark-steven-au premium answered 4 years ago


OK this finally worked for Pro install at least for me (Mac Catalina 10.15.4) 1 Download React Pro from orders page 2 copy into folder "your-app" (not my-app) 3 open packages.json file 4 Add token on line 7 (remove 4,25,5 or the version number if different and put token in) "mdbreact": "git+https://oauth2:YOURTOKENHERE@git.mdbootstrap.com/mdb/react/re-pro.git",

5 Then in terminal in your-app folder npm install Wait a bit if needed as it often seems to stop for a bit. 6 npm install git+https://oauth2:YOURTOKENINHERE@git.mdbootstrap.com/mdb/react/re-pro.git --save Have had to crash out and try again a few times at this point sometimes and alternated with Terminal npm i (install) again Then npm install git+https://oauth2:YOURTOKENINHERE@git.mdbootstrap.com/mdb/react/re-pro.git --save

Finally npm start and it is up and running Did this 6 times to make sure it was bullet proof before posting this so hopefully the next person has an easier go if it than I did

Cheers


mark-steven-au premium answered 4 years ago


I am having similar issues.Is there a page that explains properly what and how these tokens/github/ and react setup is supposed to be done. The only page I have managed to find on MDB is https://mdbootstrap.com/education/react/ which links to YouTube showing install node rpm etc. This I have done with the download of MDB React Pro 4.25.5 and get this message. Failed at the mdbreact@4.25.5 start script. Running on Mac Catalina 10.15.4 I have an older version of React on different folder working fine having installed the same way so figuring there is something I am missing that I cannot find. Have searched various fixes that say "yarn" and other dependancies need to be installed but as these suggestions are not related to MDB I would like to know for certain the steps needed to setup a viable MDB version of React to run React Pro Hoping someone out there has some ideas.


mark-steven-au premium commented 4 years ago

OK bunch more tests and trials and got it working for standard React , but not Pro


Mateusz Leciejewski staff commented 4 years ago

Hi @mark-steven-au

Use this instruction https://mdbootstrap.com/docs/react/getting-started/quick-start/

Please let us know if this quick guide was helpful.

Best, Mateusz


mark-steven-au premium commented 4 years ago

this page helped a lot for standard install


mark-steven-au premium commented 4 years ago

Hi Mateusz unfortunately the quick start for me is not able to be replicated. If I follow the instructions exactly and this is debatable as to what they are as they contradict themselves. I can easily get Standard up and running but not Pro

Here are the 2 approaches of which I have tried variants as well.

1 New folder 2 terminal nix create-react-app my-app 3 Cd my-app 4 npm install git+https://oauth2:TOKENREMOVEDP@git.mdbootstrap.com/mdb/react/re-pro.git --save 5 npm start

This built a working React but without Pro The package json file has this on lines 6-through-9 "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", "mdbreact": "git+https://oauth2:MYTOKENHERE@git.mdbootstrap.com/mdb/react/re-pro.git", SRC folder only has setup with no Pro folders setupTests.js serviceWorker.js logo.svg index.js index.css App.test.js App.js App.css

6 If I then try to npm install git+https://oauth2:MYTOKENREMOVED@git.mdbootstrap.com/mdb/react/re-pro.git --save I get this marksteven@192-168-1-104 my-app % npm install git+https://oauth2:TOKEN@git.mdbootstrap.com/mdb/react/re-pro.git --save ⸨░░░░░░░░░░░░░░░░░░⸩ ⠧ rollbackFailedOptional: verb npm-session b841f4fcb3e94603 And eventually force quit.

If I then go by the other recommended setup further down the page for Pro of new project 1 Download Pro from "Orders" portion instead of terminal 2 unzip 3 In there I then change the package json file and add token however note it is missing the "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", 4 terminal run npm install git+https://oauth2:TOKENHERE@git.mdbootstrap.com/mdb/react/re-pro.git --save

Error messages marksteven@192-168-1-104 my-app % npm install git+https://oauth2:MYTOKENHERE@git.mdbootstrap.com/mdb/react/re-pro.git --save npm ERR! code EJSONPARSE npm ERR! file /Users/marksteven/MDB pro/my-app/package.json npm ERR! JSON.parse Failed to parse json npm ERR! JSON.parse Unexpected token m in JSON at position 319 while parsing near '...eact": "./mdbreact-"mdbreact": "git+http...' npm ERR! JSON.parse Failed to parse package.json data. npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

Then 4 Npm install Failure

So it seems I can get a standard React or a Pro folder without React standard in it. And I have not even got to dependancies yet.

So hoping there is a page somewhere that has a working way of installing Pro properly with all dependancies and add ons I will keep trying a bunch of different ways to see if I can crack it but any help would be appreciated Cheers Mark



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.25.5
  • Device: Macbook Pro
  • Browser: Chrome
  • OS: MacOS Catalina
  • Provided sample code: No
  • Provided link: No