gpt4 book ai didi

npm - `npm start` 和 `npm run start` 之间有区别吗?

转载 作者:行者123 更新时间:2023-12-02 17:58:04 35 4
gpt4 key购买 nike

我能够运行 npm startnpm run start 命令。我用过create-react-app创建我的应用程序。为了在 CSS 模块中进行配置更改,我想运行 npmject 但它会抛出错误。

但是,npm run pop 命令可以工作。我很困惑为什么 npmject 不起作用。我可以配置它来工作吗?

下面是我的package.json 文件:

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

最佳答案

npm testnpm startnpm restartnpm stop 都是 的别名npm run xxx。

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

请参阅 https://docs.npmjs.com/cli/run-script 上的文档了解更多信息。

关于npm - `npm start` 和 `npm run start` 之间有区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51358235/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com