【问题标题】:Failed to create react app using "npx create-react-app signup_react"无法使用“npx create-react-app signup_react”创建反应应用程序
【发布时间】:2021-07-09 16:28:55
【问题描述】:

很遗憾,我未能使用

创建 React 应用项目
npx create-react-app signup_react

但我已经使用相同的命令制作了各种项目。我需要帮助来解决这个问题,错误如下所示,

Creating a new React app in /media/imdadul/PERSONAL/Professional Works/React_Projects/signup_react.

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

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/cli/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/imdadul/.npm/_logs/2021-07-09T16_19_45_838Z-debug.log

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

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting signup_react/ from /media/imdadul/PERSONAL/Professional Works/React_Projects
Done.

注意:请关注上述错误并帮助我了解这方面的知识,非常感谢。

npm 版本: 7.9.0

节点版本: v15.14.0

下面给出这个问题的截图,

【问题讨论】:

  • 你的npm是什么版本的?
  • npm 版本:7.9.0
  • 还有Node.js?
  • 节点版本:v15.14.0
  • 运行npm cache clean

标签: javascript reactjs create-react-app


【解决方案1】:

更新到最新的Node.js,然后 试试npm install -g npm & npm cache clean

更多: npm ERR cb() never called

【讨论】:

    【解决方案2】:

    @Alex,请关注这里, 更新后更改了npm_version: 7.19.1的版本 我已经按照你说的做了,但是我可以运行npm cache clean运行这个命令,它显示下面给出了另一个错误,

    npm ERR! As of npm@5, the npm cache self-heals from corruption issues
    npm ERR! by treating integrity mismatches as cache misses.  As a result,
    npm ERR! data extracted from the cache is guaranteed to be valid.  If you
    npm ERR! want to make sure everything is consistent, use `npm cache verify`
    npm ERR! instead.  Deleting the cache can only make npm go slower, and is
    npm ERR! not likely to correct any problems you may be encountering!
    npm ERR! 
    npm ERR! On the other hand, if you're debugging an issue with the installer,
    npm ERR! or race conditions that depend on the timing of writing to an empty
    npm ERR! cache, you can use `npm install --cache /tmp/empty-cache` to use a
    npm ERR! temporary cache instead of nuking the actual one.
    npm ERR! 
    npm ERR! If you're sure you want to delete the entire cache, rerun this command
    npm ERR! with --force.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2021-07-09T17_26_16_921Z-debug.log
    

    现在它使用npx create-react-app signup_react 命令显示另一个错误,如下所示,

    Missing dependencies in package.json
    

    请关注上述错误说明

    【讨论】:

    • npm cache clean 命令不起作用。它说If you're sure you want to delete the entire cache, rerun this command with --force.试试这个npm cache clean --force
    • @SarwarAhmed 通过卸载节点和 npm 然后重新安装它来解决它。感谢您的 cmets 并帮助我。
    猜你喜欢
    • 1970-01-01
    • 2022-10-20
    • 2020-09-16
    • 1970-01-01
    • 2020-10-31
    • 2022-07-31
    • 1970-01-01
    • 2019-11-29
    • 2021-11-27
    相关资源
    最近更新 更多