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
的使用频率足以保证一个别名。@hashlashnpm run*
也是如此npm运行foo
将运行prefoo
,foo
,postfoo
。