0
respostas

Comando npx create-react-app retorna a mensagem "A template was not provided..."

C:\Users\Nicolas\Desktop>npx create-react-app@latest nicolas-portfolio
Creating a new React app in C:\Users\Nicolas\Desktop\nicolas-portfolio.

Installing packages. This might take a couple minutes.
Installing react, react-dom, and react-scripts...

npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.

added 1391 packages, and audited 1392 packages in 2m

203 packages are looking for funding
  run `npm fund` for details

6 high severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
You can fix this by running npm uninstall -g create-react-app or yarn global remove create-react-app before using create-react-app again.

Ao iniciar um projeto React via npx create-react-app <nome-projeto>, ele é criado de maneira incompleta, contendo apenas a pasta node_modules e os arquivos package.json e package-lock.json. Já tentei várias soluções (segue abaixo cada uma delas), mas nenhuma resolveu o problema:

  • verificar se a dependência create-react-app estava instalada globalmente e, caso estivesse, dar npm uninstall -g create-react-app;
  • desinstalar o node da máquina e reinstalá-lo;
  • atualizar npm via npm install npm -g npm@latest;
  • limpar cache do npm via npm cache clean --force;
  • desinstalar a pasta node_modules na raíz do meu usuário Nicolas.

Como resolver este problema?