0

I want to try basic project from tanstack/react-table from https://github.com/TanStack/table/tree/main/examples/react/basic

I am new in NPM. I am on Windows.

I wrote:

git clone https://github.com/TanStack/table.git

then I am going to the subfolder examples\react\basic

then I wrote:

npm install 

and in subfolder "node_modules" only folders "react" and "react-dom" appeard.

There is package.json:

{
  "name": "tanstack-table-example-basic",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "serve": "vite preview",
    "start": "vite"
  },
  "dependencies": {
    "@tanstack/react-table": "^8.2.6",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@rollup/plugin-replace": "^4.0.0",
    "@vitejs/plugin-react": "^1.1.3",
    "vite": "^2.8.6"
  }
}

Please, why the "@tanstack/react-table" package is not installed?

When I wrote:

npm start

I received message:

[ERROR] [plugin vite:dep-scan] Failed to resolve entry for package "@tanstack/react-table".

I tried to write:

npm install @tanstack/react-table -g

and folder "@tanstack/react-table" appeard in folder C:\Users...\AppData\Roaming\npm\node_modules. I copied it to project folder and start project and all was OK. But I think, it is not right way.

What am I doing bad, please?

Michael
  • 2,825
  • 3
  • 24
  • 30

1 Answers1

0

do you want to add react-table to your own project or you just want to clone their project and run the samples ? for the first one you should go to your project folder and write this in cmd npm install @tanstack/react-table

for the second one you should clone their project then go to example folder then write npm install in cmd

Edit 1

  1. remove all the node_modules in any folder of project
  2. run this command in main folder yarn install
  3. run yarn install in folder examples/react/basic
  4. run command npm start in basic folder

before start you should install yarn if you didn't have it

lepsch
  • 8,927
  • 5
  • 24
  • 44
Reza Faghani
  • 141
  • 1
  • 10
  • Thank you for your answer. The second one. I did it, but the package did not appear in "node_modules". – Petr Barandovski Jul 13 '22 at 06:20
  • 1
    I found the problem do this step to run the project 1- remove all the node_modules in any folder of project 2- run this command in main folder yarn install 3- run yarn install in folder examples/react/basic 4 run command npm start in basic folder before start you should install yarn if you didn't have it – Reza Faghani Jul 13 '22 at 07:03
  • Thank You very much. Its working. Why do You think, it is not working with NPM? Should I report it somewhere? On Tanstack for example? – Petr Barandovski Jul 13 '22 at 07:33
  • I don't know why but in their document they said that use yarn too , you can report them in their github repo . if you think my answer is work for you would you please mark it as use full – Reza Faghani Jul 13 '22 at 12:52
  • Ok. I marked It. Thank You. Can you please aprove my edit of your answer? – Petr Barandovski Jul 14 '22 at 11:04