create-single-spa
create-single-spa copied to clipboard
Cannot create React MFE using create-single-spa
The following is the verbatim console with my inputs and all the output:
PS C:\Users\webJo\src> npm create single-spa
Need to install the following packages:
[email protected]
Ok to proceed? (y)
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
> npx
> create-single-spa
(node:35836) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
? Directory for new project csspaTest
? Select type to generate single-spa application / parcel
? Which framework do you want to use? react
? Which package manager do you want to use? npm
? Will this project use Typescript? Yes
? What module format should this microfrontend be bundled to? esm
? Organization name (can use letters, numbers, dash or underscore) create-sspa
? Project name (can use letters, numbers, dash or underscore) mfe1
Initialized empty Git repository in C:/Users/webJo/src/csspaTest/.git/
Initialized git repository
create csspaTest\package.json
create csspaTest\jest.config.js
create csspaTest\babel.config.json
create csspaTest\.eslintrc
create csspaTest\.gitignore
create csspaTest\.husky\pre-commit
create csspaTest\src\declarations.d.ts
create csspaTest\.prettierignore
create csspaTest\webpack.config.js
create csspaTest\src\root.component.tsx
create csspaTest\src\root.component.test.tsx
create csspaTest\src\create-sspa-mfe1.tsx
create csspaTest\tsconfig.json
No change to package.json was detected. No package manager install will be executed.
I'm all done. Running npm install for you to install the required dependencies. If this fails, try running the command yourself.
npm warn config cache-min This option has been deprecated in favor of `--prefer-offline`.
npm error code ETARGET
npm error notarget No matching version found for @babel/eslint-parser@^7.23.3.
npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist.
npm error A complete log of this run can be found in: C:\Users\webJo\AppData\Local\npm-cache\_logs\2025-02-24T22_03_25_270Z-debug-0.log
Project setup complete!
Steps to test your React single-spa application:
1. Run 'npm start -- --port 8500'
2. Go to http://single-spa-playground.org/playground/instant-test?name=@create-sspa/mfe1&url=8500 to see it working!
As suggested, I tried running npm install myself:
PS C:\Users\webJo\src> cd .\csspaTest\
PS C:\Users\webJo\src\csspaTest> npm install
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @testing-library/[email protected]
npm error Found: @types/[email protected]
npm error node_modules/@types/react
npm error @types/react@"^17.0.19" from the root project
npm error peer @types/react@"^17.0.0" from @types/[email protected]
npm error node_modules/@types/react-dom
npm error @types/react-dom@"^17.0.9" from the root project
npm error peerOptional @types/react-dom@"*" from [email protected]
npm error node_modules/single-spa-react
npm error single-spa-react@"^6.0.2" from the root project
npm error 1 more (single-spa-react)
npm error
npm error Could not resolve dependency:
npm error peerOptional @types/react@"^18.0.0 || ^19.0.0" from @testing-library/[email protected]
npm error node_modules/@testing-library/react
npm error dev @testing-library/react@"^16.0.1" from the root project
npm error
npm error Conflicting peer dependency: @types/[email protected]
npm error node_modules/@types/react
npm error peerOptional @types/react@"^18.0.0 || ^19.0.0" from @testing-library/[email protected]
npm error node_modules/@testing-library/react
npm error dev @testing-library/react@"^16.0.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error C:\Users\webJo\AppData\Local\npm-cache\_logs\2025-02-24T22_05_05_528Z-eresolve-report.txt
npm error A complete log of this run can be found in: C:\Users\webJo\AppData\Local\npm-cache\_logs\2025-02-24T22_05_05_528Z-debug-0.log
I had the same issue. It looks like "@testing-library/react" version is incompatible. Remove "@testing-library/react" in package.json. Then run npm install again. It will fix the installation process. Then install "@testing-library/react" library manually if you need it.