Reactjs npm启动在WebStorm上的React应用程序中产生错误
我知道以前有人问过这个问题,但似乎没有一个解决方案对我有帮助 出现错误,我试图删除Reactjs npm启动在WebStorm上的React应用程序中产生错误,reactjs,webstorm,Reactjs,Webstorm,我知道以前有人问过这个问题,但似乎没有一个解决方案对我有帮助 出现错误,我试图删除节点\u模块目录。然后重新安装npm。还是一样的错误 rm-rf节点模块 npm安装 npm启动 --同样的错误 甚至尝试删除包锁.json,但在npm启动时出现相同错误 节点版本-v10.15.3 NPM版本-6.4.1 Aryans-MacBook-Pro:react-new-app aryanarora$ npm start > react-new-app@0.1.0 start /Users/ary
节点\u模块
目录。然后重新安装npm。还是一样的错误
rm-rf节点模块
npm安装
npm启动
--同样的错误包锁.json
,但在npm启动时出现相同错误
节点版本-v10.15.3NPM版本-6.4.1
Aryans-MacBook-Pro:react-new-app aryanarora$ npm start
> react-new-app@0.1.0 start /Users/aryanarora/Desktop/The Web Developer Bootcamp/01 All Practice Files /js<:>/Jon Duckett/react-new-app
> 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! react-new-app@0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the react-new-app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/aryanarora/.npm/_logs/2019-04-29T06_08_07_273Z-debug.log
Package.json文件
{
"name": "react-new-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
请确保安装了
React scripts
节点模块,若要检查此情况,请执行以下步骤
- 再次安装
npm安装
- 转到节点_模块-->反应脚本(确保文件夹存在)
- 运行
npm启动
- 卸载纱线
npm卸载-g纱线
- 进行缓存清理<代码>npm缓存清理-f
- 如果仍然不起作用,请尝试将您的npm版本降级/升级到npm 5.4.2或npm 5.3。*
npm安装-gnpm@5.4.2
- 这可能是npm版本的问题。请尝试一些建议
问题可能是节点和npm本身。 尝试使用自制或NVM(无论您使用哪种方法安装node)从您的计算机上完全卸载node。否则你必须手动操作 请按照此链接中的步骤进行操作- 接下来从官方网站()安装LTS节点,这应该可以解决问题
我还发现有一件事很有帮助,那就是更改目录。我的目录中有一个名为“
js
”的文件夹,我认为这是一个权限问题。似乎是一个权限问题(enoint-Error No entry),我可以知道你使用的是什么操作系统吗?你能附加package.json
?和npm列表的结果——深度0 | grep react脚本@DularaMalindu MacOs版本-10.12。6@JayLim对不起,你这是什么意思?项目中已经有一个package.json文件。
{
"name": "react-new-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}