我使用npm create-react-app 创建一个新的应用程序 这是我的 package.json文件
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
这是错误代码:
npm run eject
npm ERR! missing script: eject
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\acmilanyjguo\AppData\Roaming\npm-cache\_logs\2020-08-28T04_26_15_274Z-debug.log
这是日志文件:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'eject'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v12.18.2
4 verbose config Skipping project config: C:\Users\acmilanyjguo/.npmrc. (matches userconfig)
5 verbose stack Error: missing script: eject
我无法运行弹出,找不到原因。我想知道原因,谢谢。
答案 0 :(得分:0)
我遇到了同样的问题。 你必须检查你的构建在哪里。
如果它在您的前端,则 class Program
{
static void Main(string[] args)
{
var res = Json; //Json that has to be converted
Response resp = new Response();
resp = JsonSerializer.Deserialize<Response>(res);
Console.WriteLine(res);
}
}
public class Response
{
public bool isValidUser { get; set; }
public string message { get; set; }
public int resultKey { get; set; }
}
并提示 cd frontend
如果它在您的后端,则在 npm run eject
和提示 backend
对我来说,构建在前端包中,我在后端暗示,因为它不起作用