npm start如何指定index.js以外的启动文件 [英] npm start how to specify start file other than index.js
本文介绍了npm start如何指定index.js以外的启动文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的Package.json文件:
{
"name": "todo",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
我尝试更改:
"start": "react-scripts start",
至
"start": "node index.js", or "start": "node ./src/index.js",
但这些不起作用
推荐答案
查找并编辑Package.json文件。例如:
{
"name": "build",
"version": "0.0.1",
"scripts": {
"start": "node different-file.js"
}
}
这篇关于npm start如何指定index.js以外的启动文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文