alibaba / hooks

A high-quality & reliable React Hooks library. https://ahooks.pages.dev/
https://ahooks.js.org/
MIT License
14.06k stars 2.71k forks source link

npm start报错 #299

Closed headwindz closed 4 years ago

headwindz commented 4 years ago

复现步骤:

$ git clone git@github.com:umijs/hooks.git
$ cd hooks
$ npm run init
$ npm start

报错信息

→ npm run start

> @umijs/hooks@ start /Users/michaelzheng/github/hooks
> npm run dev

> @umijs/hooks@ dev /Users/michaelzheng/github/hooks
> father-doc dev

✖  error     Plugin user:node_modules/umi-plugin-father-doc/lib/index.js initialize failed

The "path" argument must be of type string. Received undefined
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:117:11)
    at Object.join (path.js:1039:7)
    at map (/Users/michaelzheng/github/hooks/node_modules/umi-plugin-father-doc/lib/index.js:120:65)
    at Array.map (<anonymous>)
    at _default (/Users/michaelzheng/github/hooks/node_modules/umi-plugin-father-doc/lib/index.js:120:27)
    at Service.initPlugin (/Users/michaelzheng/github/hooks/node_modules/umi-build-dev/lib/Service.js:224:7)
    at /Users/michaelzheng/github/hooks/node_modules/umi-build-dev/lib/Service.js:267:12
    at Array.forEach (<anonymous>)
    at Service.initPlugins (/Users/michaelzheng/github/hooks/node_modules/umi-build-dev/lib/Service.js:266:13)
    at Service.init (/Users/michaelzheng/github/hooks/node_modules/umi-build-dev/lib/Service.js:400:10) {
  code: 'ERR_INVALID_ARG_TYPE'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @umijs/hooks@ dev: `father-doc dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @umijs/hooks@ dev 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/michaelzheng/.npm/_logs/2020-03-16T02_11_06_557Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @umijs/hooks@ start: `npm run dev`
npm ERR! Exit status 1

node版本: v12.16.1

brickspert commented 4 years ago

先基于 v1.8.0 分支开发

headwindz commented 4 years ago

v1.8.0 好像有另外一个问题。

→ npm run start

> @umijs/hooks@ start /Users/michaelzheng/github/hooks
> npm run dev

> @umijs/hooks@ dev /Users/michaelzheng/github/hooks
> dumi dev

Starting the development server...
bad indentation of a sequence entry at line 11, column 11:
        desc: @umijs/hooks contains a large se ...
              ^
YAMLException: bad indentation of a sequence entry at line 11, column 11:
        desc: @umijs/hooks contains a large se ...
              ^
    at generateError (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
    at throwError (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:173:9)
    at readBlockSequence (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:962:7)
    at composeNode (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:1358:12)
    at readBlockMapping (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:1089:11)
    at composeNode (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:1359:12)
    at readDocument (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:1519:3)
    at loadDocuments (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:1575:5)
    at load (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:1596:19)
    at Object.safeLoad (/Users/michaelzheng/github/hooks/node_modules/js-yaml/lib/js-yaml/loader.js:1618:10)
headwindz commented 4 years ago

已找到问题。 index.en-US.md 里的 @ 字符导致