简体   繁体   English

NPM 启动问题(React)

[英]Issue with NPM start ( React)

I have just tried to view an old application of mine using npm start but it wont load keep getting the error.我刚刚尝试使用 npm 开始查看我的旧应用程序,但它不会加载并不断出现错误。

Cannot find module 'C:\Users\Team Knowhow\development\Punk-API\node_modules\react-scripts\bin\react-scripts.js. 

I tried creating a new react app and NPM start works fine so have no idea what the issue is with my old react app and why NPM start does not work.我尝试创建一个新的 React 应用程序并且 NPM 启动工作正常所以不知道我的旧 React 应用程序有什么问题以及为什么 NPM 启动不起作用。

Have you installed dependencies first using npm install .您是否首先使用npm install安装了依赖项。

If done already, try removing node_modules folder and installing dependencies again.如果已经完成,请尝试删除node_modules文件夹并再次安装依赖项。

Make sure you have installed all dependencies including react-scripts !确保你已经安装了所有依赖项,包括react-scripts

You've to ensure that all the dependencies that your application is using is mentioned in the correct manner with their correct version in your pacakage.json file.您必须确保在pacakage.json文件中以正确的方式提及您的应用程序正在使用的所有dependencies项及其正确的版本。 And if that looks alright then run如果这看起来没问题,那么运行

npm i

or或者

npm install

This command will download all the dependencies that are mentioned in your package.json file.此命令将下载package.json文件中提到的所有依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM