ELIFECYCLE code 2 ошибка eslint с библиотекой create-react-library - PullRequest
1 голос
/ 06 августа 2020

Я хотел бы создать повторно используемую библиотеку компонентов реакции, и для котельной пластины я пришел cross create-react-library - https://www.npmjs.com/package/create-react-library.

Я выполнил шаги по созданию новую библиотеку с помощью команды npx, и это было успешно.

Я обнаружил, что мне не удалось запустить npm run test, но если я запустил eslint . в командной строке, он работает нормально, поэтому не уверен, что получаю эту ошибку.

Редактор кода: Код Visual Studio.

MacBook:testlib xx$ npm run test

> testlib@1.0.0 test /Users/xx/Documents/Repos/testlib
> run-s test:unit test:lint test:build


> testlib@1.0.0 test:unit /Users/xx/Documents/Repos/testlib
> cross-env CI=1 react-scripts test --env=jsdom

PASS src/index.test.tsx
  ExampleComponent
    ✓ is truthy (6ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        5.4s
Ran all test suites.

> testlib@1.0.0 test:lint /Users/xx/Documents/Repos/testlib
> eslint .


Oops! Something went wrong! :(

ESLint: 6.8.0.

No files matching the pattern "." were found.
Please check for typing mistakes in the pattern.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! testlib@1.0.0 test:lint: `eslint .`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the testlib@1.0.0 test:lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xx/.npm/_logs/2020-08-06T10_19_00_172Z-debug.log
ERROR: "test:lint" exited with 2.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testlib@1.0.0 test: `run-s test:unit test:lint test:build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the testlib@1.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xx/.npm/_logs/2020-08-06T10_19_00_222Z-debug.log
...