我安装了create-react-app
,但没有-g
C:\Users\user1\projects\react>npm install create-react-app
但是当我运行时
C:\Users\user1\projects\react>create-react-app my-app1
我收到以下错误
“create-react-app”未被识别为内部或外部命令、可操作程序或批处理文件。
谁能帮我理解 -g
标志的作用
如果我不想全局安装怎么办?
如何在不全局安装的情况下使其工作?
最佳答案
what if I dont want to install it globally?
How do I make it work without installing globally?
该软件包设计为全局安装。请按预期使用。
如果您不想永久安装它,在最新的 Node 版本中,您实际上可以运行它,而无需通过 npx
安装:
npx create-react-app my-app
关于reactjs - 安装了不带-g的create-react-app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47397471/