Edw*_*uay 5 javascript npm reactjs
在我的package.json我有以下脚本块:
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Run Code Online (Sandbox Code Playgroud)
据我所知,当我们键入npm start或npm run start执行start.
当我输入时,npm start它会启动我的 React 应用程序。
为什么当我输入 时react-scripts start,它会显示:
bash: react-scripts: command not found
Run Code Online (Sandbox Code Playgroud)
如果您全局安装,react-scripts则可以运行它。
npm install -g react-scripts
Run Code Online (Sandbox Code Playgroud)
但在您的设置中,它位于节点模块下。所以,只有 npm 可以运行它。
./node_modules/.bin/react-scripts start
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5159 次 |
| 最近记录: |