我是 React js 初学者
我正在创建反应应用程序,它给了我一个错误,我正在尝试做所有的事情
cmd 创建应用程序
npx create-react-app my-app or npx create-react-app@latest your-app-name --use-npm
错误
npx create-react-app my-reactchat-app
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dp312\AppData\Roaming\npm-cache\_logs\2023-01-25T22_46_04_461Z-debug.log
Install for [ 'create-react-app@latest' ] failed with code 1
我尝试在两种模式下执行此命令管理员模式也
npm cache clean --force
运行此命令时
npm create-react-app my-app
它给我这样的错误
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, fund, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
C:\Users\dp312\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
[email protected] C:\Program Files\nodejs\node_modules\npm
也尝试这样做这个,但仍然是错误而不是灵魂
如何解决这个错误?
任何人都可以帮助我
在 package.json 中定义节点引擎配置 另外,请检查您的节点版本,使其保持最新。 检查您是否正在从应用程序文件夹内部运行该应用程序。
您可以尝试以下几种方法来解决此问题:
Node
和 npm
。create-react-app
全局安装 npm install -g create-react-app
。安装后,运行create-react-app my-app
。