Reactjs 创建react应用程序仅创建节点_模块、包和包锁
在我的终端:Reactjs 创建react应用程序仅创建节点_模块、包和包锁,reactjs,Reactjs,在我的终端: D:\>npx create-react-app myapp npx: installed 98 in 21.893s Creat
D:\>npx create-react-app myapp
npx: installed 98 in 21.893s
Creating a new React app in D:\myapp.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
> core-js@2.6.11 postinstall D:\myapp\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@3.6.5 postinstall D:\myapp\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure@3.6.5 postinstall D:\myapp\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
+ react-scripts@3.4.1
+ react-dom@16.13.1
+ cra-template@1.0.3
+ react@16.13.1
added 1613 packages from 750 contributors and audited 921730 packages in 287.89s
58 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
安装后的My package.json:
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"cra-template": "1.0.3",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-scripts": "3.4.1"
}
}
然后它就永远停在那里。
我尝试安装global create react应用程序,更新最新的npm,删除Appdata中的npm,但仍然无法运行,需要帮助自从创建react应用程序3.3.0以来,不再建议使用CRA的全局安装。 这是github上提出的一个问题,但在解决了这个问题之后,它就被关闭了
npm rm -g create-react-app
npm install create-react-app
npx create-react-app my-app
它所做的只是:
命令1:删除全局安装的create react应用程序
命令2:在本地安装CreateReact应用程序
命令3:创建具有所有预期文件结构的新react应用程序
试试这个,如果不起作用,请检查以下说明
仅适用于Windows用户
这对许多windows用户来说是个问题
即使尝试了所有故障排除步骤,也无法解决问题
最后发现他们的环境变量中缺少一些路径
C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem
注意:我们不是在这里讨论设置npm路径
直到这些变量被添加到env变量中,它才得到解决
C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem
其区分大小写,请完全按照所述粘贴它
然而,随着时间的推移,这些错误变得越来越少,不确定这是否有帮助。我遇到了同样的问题。可能由于某种原因,您的Powershell运行脚本的权限被禁用
set executionpolicy remotesigned
”并按enter键希望这有帮助。对我有效。什么不起作用react或npm?尝试升级到最新版本create react appIn create-react-app.dev他们说“当你运行npx create react app my app时,它会自动安装最新版本的create react app。”我用您的代码更新了我的路径,但仍然是相同的问题create react app 3.3.0不再建议使用CRA的全局安装。因此,请尝试在本地安装CreateReact应用程序……我已经更新了答案,请尝试按照上面提到的方式发出命令2