简体   繁体   中英

nodejs searchkit demos “Cannot find module 'react'.”

I'm trying to install a searchkit demo "IMDB Search Demo": http://searchkit.co/demos

I copied the contents of: https://github.com/searchkit/searchkit-demo to a folder on my Desktop

I installed nodejs, went into that folder in cmd, typed "npm install" and "npm start"

There is a ridiculously large list of errors that say for example:

ERROR in ./src/index.tsx
(2,24): error TS2307: Cannot find module 'react'.

and at the end:

webpack: Failed to compile

I then used "npm i -S react" to install react myself.

npm start: same error messages.

At localhost:3000 there opens a webpage that says "Sample App" in the header, but the page is blank white.

Do you have any Idea why this does not work? I tried it on ubuntu: same result, so i guess I'm missing something important.

Thanks.

You may have forgotten to install tsd package manager and run tsd install as stated in searchkit-demo project :

npm install tsd -g

Then install with tsd and npm (react is installed with tsd ) :

tsd install
npm install

Then with npm start :

webpack built e4e4b2ce528a415bed3e in 5340ms
Version: webpack 1.14.0
Time: 5340ms
    Asset     Size  Chunks             Chunk Names
bundle.js  2.79 MB       0  [emitted]  main
webpack: Compiled successfully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM