首页 > 解决方案 > 当我尝试教程时,React 不断中止安装

问题描述

我今天试图按照反应网站上的教程进行操作,但是无论出于何种原因,当我运行命令时它都不想为我工作:

npx create-react-app my-app

`我收到以下错误信息;

Creating a new React app in D:\NodeJs\react\my-app.

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


npm ERR! code ETARGET
npm ERR! notarget No matching version found for postcss@^7.0.11
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'autoprefixer'
npm ERR! notarget

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\matth\AppData\Roaming\npm-cache\_logs\2019-01- 
12T17_55_39_805Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react- 
 scripts has failed.

Deleting generated file... package.json
Deleting my-app/ from D:\NodeJs\react
Done.`

我的 npm 版本是 6.5.0,Node 是 11.6.0

不知道到底发生了什么,因为当我在我的工作笔记本电脑上执行此操作时,它与完全相同版本的节点和 npm 没有任何问题

标签: javascriptnode.jsreactjs

解决方案


只是给大家的更新。它现在起作用了。我所做的只是第四次重新安装 nodejs,仅此而已。0 有意义。无论如何,谢谢你的回答,不胜感激。


推荐阅读