我无法使用NPM安装react js。我收到以下错误。
您的环境已设置为使用Node.js 12.3.1(ia32)和npm。 C:\ Users \ User> npm install create-react-app -g npm错误!代码UNABLE_TO_VERIFY_LEAF_SIGNATURE npm错误! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE npm错误!对https://registry.npmjs.org/create-react-app的请求失败,原因: 无法验证第一个证书 npm错误!可以在以下位置找到此运行的完整日志: npm错误! C:\ Users \ User \ AppData \ Roaming \ npm-cache_logs \ 2019-12-14T05_54_58_7 16Z-debug.log 我来自印度,并且未使用任何公司防火墙或VPN。 答案 0 :(得分:0) 下载Node.js存档 成功安装NodeJS之后,我们可以使用npm开始在其上安装React。您可以通过两种方式安装ReactJS。 但是我告诉您有关使用create-react-app命令的信息: 答案 1 :(得分:0) 嘿,您可以尝试使用2 个答案:
- Using webpack and babel.
- Using the create-react-app command.
- Instead of using webpack and babel you can install ReactJS more simply by installing create-react-app.
Browse through the desktop and install the Create React App using command prompt as shown below:
Step 1: go to your specific directory and run below commands inside the folder like as below:
Step 2: d:\reactproject\>npx create-react-app my-app
Step 3: cd my-app
Step 4: npm start
npx create-react-app ${your project name}