Unable to run `react/playground` locally with `npm`, `yarn` and `pnpm`: `Cannot resolve dependency 'cross-fetch/polyfill'`
joepio opened this issue Β· comments
Description
I'm trying to run the playground examples locally, but fail to do so.
First, I tried with npm i
and npm run start
, which resulted in
> react-playground@0.1.0 start
> parcel serve index.html --open --port 1111
node:internal/modules/cjs/loader:955
const err = new Error(message);
^
Error: Cannot find module 'babel-types'
Require stack:
with yarn
:
yarn install v1.22.18
[1/4] π Resolving packages...
[2/4] π Fetching packages...
[3/4] π Linking dependencies...
warning "react-instantsearch-dom > algoliasearch-helper@3.7.0" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
warning "react-instantsearch-dom > react-instantsearch-core@6.12.1" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
error An unexpected error occurred: "EEXIST: file already exists, mkdir '/Users/joep/dev/zandbak/instant-meilisearch/playgrounds/react/node_modules/define-property/node_modules'".
info If you think this is a bug, please open a bug report with the information provided in "/Users/joep/dev/zandbak/instant-meilisearch/playgrounds/react/yarn-error.log".
with pnpm
and pnpm start
/Users/joep/dev/zandbak/instant-meilisearch/playgrounds/react/node_modules/@babel/runtime/helpers/esm/defineProperty.js: ENOENT: no such file or directory, open '/Users/joep/dev/zandbak/instant-meilisearch/playgrounds/react/node_modules/@babel/runtime/helpers/esm/defineProperty.js'
Environment (please complete the following information):
- OS: MacOS
- instant-meilisearch version:
df4714f
Hey @joepio, could you delete your node_modules
in /Users/joep/dev/zandbak/instant-meilisearch/playgrounds/react/node_modules/
and retry with yarn
?
Also, you can directly run the react playground from the root directory:
yarn playground:react
If you want a playground that setups a local environment for you, you can also do the following:
$ yarn local:env:setup
$ local:env:react
Otherwise it is a playground running against a remote server, which of course might be what you are looking for.
Removing node_modules
and re-running yarn
did it for me. Thanks @bidoubiwa !