javascript - 如何使用 reactjs 的 package.json 脚本使文件可运行?
问题描述
我有一个文件夹 bin,其中包含文件 initLocale:
https://gist.github.com/IchrakMansour/6664b6e6dd871616dc3eae024f5e209f#file-initlocale
我想让它可运行并在文件 package.json 上制作:
"scripts": {
"start": "npm run initLocale && react-scripts start",
"build": "npm run initLocale:build && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"initLocale": "bin/initLocale start && npm run compile",
"initLocale:build": "bin/initLocale build && npm run compile",
"add-locale": "lingui add-locale",
"extract": "lingui extract",
"compile": "lingui compile"
},
当我跑步时npm run start
,我得到:
> bin/initLocale start && npm run compil
'bin' n’est pas reconnu en tant que comm
ou externe, un programme exécutable ou u
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! alaxbayer@0.1.0 initLocale: `bi
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the alaxbayer@0.1.0 i
npm ERR! This is probably not a problem
npm ERR! A complete log of this run can
npm ERR! C:\Users\ichra\AppData\Roam
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! alaxbayer@0.1.0 start: `npm run
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the alaxbayer@0.1.0 s
npm ERR! This is probably not a problem
npm ERR! A complete log of this run can
npm ERR! C:\Users\ichra\AppData\Roam
The terminal process terminated with exi
我该如何解决?
解决方案
推荐阅读
- wikipedia - 如何获取包含我需要的所有信息的 wikipedia xml 页面?
- python-3.x - 用 1 次 plt.text 调用绘制 2 条文本行
- keras - 随机性能的验证和测试准确度,而训练准确度非常高
- react-native - 与 expo-sharing 共享 base64
- remote-desktop - Visual Studio 2019 在远程服务器上通过远程桌面模糊
- ios - Swift 5 - 布局错误
- ios - 用户重新启动 iPhone 后,如何重新启动移动应用程序(其后台服务)?
- python - 以 12 小时格式匹配日期和时间
- r - 从 R 中的文本中删除换行符 \n
- verilog - 使用 Verilog 的 Mux 4x1 测试台