无法在 Mac 上设置 ReactJS [英] can not setup ReactJS on mac
问题描述
我需要在我的 Mac 上设置 ReactJS.我有 4.1.2 的 npm
版本和 v7.7.4 的 node
版本.我从 Git 克隆项目并在项目文件夹中尝试执行 npm install
并遵循 npm start
.但我得到错误.我删除并卸载了 node 和 npm,然后用自制软件重新安装,但没有帮助.这是我在终端中遇到的错误屏幕?你知道有什么问题吗?
I need to setup ReactJS on my Mac. I have npm
version of 4.1.2 and node
version of v7.7.4. I clone the project from Git and in the project folder trying to execute npm install
and following npm start
. But I get error.
I removed&uninstalled node and npm and then re-installed with homebrew, but it did not help. Here is the screen of error I get in terminal? Do you have any idea what is the problem?
这是我的 package.json
文件
{
"name": "viaopt",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {},
"devDependencies": {
"webpack": "^2.3.0"
},
"description": ""
}
推荐答案
从您显示的错误中,我可以看出您的 package.json 文件中没有 start 脚本.要使 npm start
工作,package.json
scripts 属性下的 start
键下应该有一个命令> 文件.
From the error you are showing I can tell that there is no start script in your package.json file. For npm start
to work there should be a command under the start
key under the scripts
attribute in your package.json
file.
当您运行 npm start
时,npm 在 package.json 中查找并运行 start
值下列出的任何内容.
When you run npm start
npm looks in package.json and runs whatever is listed there under the start
value.
我猜你的项目配置了 gulp 或 webpack?
I'm guessing you have gulp or webpack configured with your project?
尝试在您的终端中运行 webpack,看看您的项目是否启动.
Try running webpack in your terminal and see if your project fires up or smth.
希望这会有所帮助.干杯.
Hopes this helps. Cheers.
这篇关于无法在 Mac 上设置 ReactJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!