我卸载了visual studio code和node js。重启机器。再次安装了visual studio和node js。但问题就在这里。
PS D:\React> npm create-react-app myapp
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\ee209495\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@6.14.9 C:\Program Files\nodejs\node_modules\npm
答案 0 :(得分:1)
您之前安装过 create-reat-app 吗?
npm install -g create-react-app
此外,您可以使用 npx,因此它将使用最新的 npm 版本
npx create-react-app my-app
答案 1 :(得分:1)
您首先需要全局安装 create-react-app
包
npm i -g create-react-app
create-react-app my app
或者您可以使用 npx 始终使用最新版本的 CRA
npx create-react-app my-app