npm启动和npm运行启动之间的差异

npm启动和npm运行启动之间的差异,npm,Npm,我已经检查了两个命令npm start和npm run start,这两个命令都非常有效。我使用了CreateReact应用程序。但是为了在CSS模块中进行配置更改,我运行了npm-eject,但它抛出了一个错误 但是npm运行弹出有效吗?我不明白为什么npm-eject不起作用。我可以配置这个吗 下面是我的包.json: "scripts": { "start": "react-scripts start", "build": "react-scripts build",

我已经检查了两个命令
npm start
npm run start
,这两个命令都非常有效。我使用了CreateReact应用程序。但是为了在CSS模块中进行配置更改,我运行了
npm-eject
,但它抛出了一个错误

但是
npm运行弹出
有效吗?我不明白为什么
npm-eject
不起作用。我可以配置这个吗

下面是我的
包.json

  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }

npm测试
npm启动
npm重启
npm停止
都是
npm运行xxx的别名。

对于您定义的所有其他
脚本
,您需要使用
npm run xxx
语法


有关更多信息,请参阅中的文档。

npm start
npm run start
的缩写形式。所以,这是同一件事。

就像我是新手一样,我不清楚有别名的人我的意思是
npm test
做的正是
npm run test
做的,
npm start
做的正是
npm run start
做的,依此类推。为什么开始是别名而构建不是?@user1912383您必须询问npm的作者。我想
npm start
的使用频率足以保证一个别名。@hashlash
npm run*
也是如此
npm运行foo
将运行
prefoo
foo
postfoo