如何使用React.js的package.json脚本使文件可运行?

时间:2020-05-26 07:30:26

标签: javascript reactjs package.json npm-scripts react-scripts

我有一个文件夹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

我该如何解决?

0 个答案:

没有答案