反应脚本:找不到命令 [英] react-scripts: command not found
问题描述
我目前正在尝试使用 create-react-app,它使用三个不同的包:react、react-scripts 和 react-dom.我已经安装了 create-react-app,然后当我切换到目录并点击 npm start
时,我得到一个 react-scripts: command not found
.我遇到了很多问题.我可以看到 react-scripts
在我的 node_modules
文件夹中,但是在尝试运行 npm start
时我一直收到 command not found
代码>.我试图删除并重新安装我所有的 node_modules
但它没有用.还有其他人遇到这个问题吗?
I am currently trying to use create-react-app which uses three different packages: react, react-scripts and react-dom. I have installed create-react-app and then when I change into the directory and hit npm start
I get a react-scripts: command not found
. I've ran into a lot of problems with this. I can see react-scripts
is in my node_modules
folder but I keep getting command not found
when trying to run npm start
. I tried to delete and re-install all of my node_modules
but it didn't work. Anyone else having this issue?
✘ ✝ Node/toDoApp/my-test master± npm start
> my-test@0.1.0 start /Users/jzilch/Desktop/Web
Projects/Node:Express/Node/toDoApp/my-test
> react-scripts start
sh: react-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! my-test@0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the my-test@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
推荐答案
首先删除项目文件夹中的 package-lock.json
文件.
Firstly Delete package-lock.json
file in your project folder.
然后通过 npm install
再次安装依赖项.那应该可以解决这个问题.
And then install dependencies again by npm install
. That should solve this issue.
这篇关于反应脚本:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!