umijs / sylvanas

Convert TypeScript to JavaScript
45 stars 4 forks source link

cannot find module ... #7

Open shaodahong opened 5 years ago

shaodahong commented 5 years ago

@zombieJ @sorrycc 你们有出现过这个错误么,使用 yarn 安装就不行,npm i没问题,我是在 antd 发现的

(node:72343) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
ℹ 「wds」: Project is running at http://localhost/ℹ 「wds」: webpack output is served from undefined
ℹ 「wds」: Content not from webpack is served from /Users/shaodahong/Workspace/github/ant-design/_siteℹ 「wds」: 404s will fallback to /index.html
/Users/shaodahong/Workspace/github/ant-design/node_modules/sylvanas/node_modules/eslint/lib/config/config-file.js:463
            throw e;
            ^

Error: Cannot find module 'eslint-plugin-eslint-comments'
Referenced from: 
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.resolve (internal/modules/cjs/helpers.js:33:19)
    at resolve (/Users/shaodahong/Workspace/github/ant-design/node_modules/sylvanas/node_modules/eslint/lib/config/config-file.js:498:31)
    at load (/Users/shaodahong/Workspace/github/ant-design/node_modules/sylvanas/node_modules/eslint/lib/config/config-file.js:579:26)
    at configExtends.reduceRight (/Users/shaodahong/Workspace/github/ant-design/node_modules/sylvanas/node_modules/eslint/lib/config/config-file.js:453:36)
zombieJ commented 5 years ago

eslint-plugin-eslint-comments 来自于 @umijs/fabricdependencies 看起来应该不会报错才对……

https://github.com/umijs/sylvanas/blob/master/package.json#L22

shaodahong commented 5 years ago

源头是 bisheng-plugin-antd 不知道是不是 yarn 和 npm 的哪个钩子不一致导致的,我之前有做过 yarn cache clean 操作,平时开发都是用的 yarn

shaodahong commented 5 years ago

刚才试了下还是不行

$ yarn -v   
1.19.1

$ node -v
v10.16.3

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15
BuildVersion:   19A583
zombieJ commented 5 years ago

先用 cnpm 吧,估计要 bisheng 修一下才行。

chenshuai2144 commented 4 years ago

这个是 fabrci 的问题升级到 2 就能解决,因为 node 的版本要求问题,所以 yarn 直接不给你安装了

zybn2004 commented 4 years ago

@zombieJ @sorrycc 你们有出现过这个错误么,使用 yarn 安装就不行,npm i没问题,我是在 antd 发现的

(node:72343) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
ℹ 「wds」: Project is running at http://localhost/ℹ 「wds」: webpack output is served from undefined
ℹ 「wds」: Content not from webpack is served from /Users/shaodahong/Workspace/github/ant-design/_siteℹ 「wds」: 404s will fallback to /index.html
/Users/shaodahong/Workspace/github/ant-design/node_modules/sylvanas/node_modules/eslint/lib/config/config-file.js:463
            throw e;
            ^

Error: Cannot find module 'eslint-plugin-eslint-comments'
Referenced from: 
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.resolve (internal/modules/cjs/helpers.js:33:19)
    at resolve (/Users/shaodahong/Workspace/github/ant-design/node_modules/sylvanas/node_modules/eslint/lib/config/config-file.js:498:31)
    at load (/Users/shaodahong/Workspace/github/ant-design/node_modules/sylvanas/node_modules/eslint/lib/config/config-file.js:579:26)
    at configExtends.reduceRight (/Users/shaodahong/Workspace/github/ant-design/node_modules/sylvanas/node_modules/eslint/lib/config/config-file.js:453:36)

11 我解决了

otakustay commented 3 years ago

我使用dumi时有个类似的问题:

Failed to load plugin jsx-a11y: Cannot find module 'eslint-plugin-jsx-a11y'
Require stack:
- /Users/otakustay/Develop/react-hooks/node_modules/sylvanas/node_modules/eslint/lib/config/plugins.js
- /Users/otakustay/Develop/react-hooks/node_modules/sylvanas/node_modules/eslint/lib/config.js
- /Users/otakustay/Develop/react-hooks/node_modules/sylvanas/node_modules/eslint/lib/cli-engine.js
- /Users/otakustay/Develop/react-hooks/node_modules/sylvanas/node_modules/eslint/lib/api.js
- /Users/otakustay/Develop/react-hooks/node_modules/sylvanas/lib/eslintJs.js
- /Users/otakustay/Develop/react-hooks/node_modules/sylvanas/lib/index.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/preset-dumi/lib/transformer/remark/rehype.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/preset-dumi/lib/transformer/remark/index.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/preset-dumi/lib/transformer/index.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/preset-dumi/lib/routes/getFrontMatter.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/preset-dumi/lib/routes/decorator/frontMatter.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/preset-dumi/lib/routes/decorator/index.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/preset-dumi/lib/routes/getRouteConfig.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/preset-dumi/lib/plugins/core.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/core/lib/Service/utils/pluginUtils.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/core/lib/Service/Service.js
- /Users/otakustay/Develop/react-hooks/node_modules/@umijs/core/lib/index.js
- /Users/otakustay/Develop/react-hooks/node_modules/umi/lib/ServiceWithBuiltIn.js
- /Users/otakustay/Develop/react-hooks/node_modules/umi/lib/cli.js
- /Users/otakustay/Develop/react-hooks/node_modules/umi/bin/umi.js
Referenced from: /Users/otakustay/Develop/react-hooks/node_modules/eslint-config-airbnb/index.js
Referenced from: /Users/otakustay/Develop/react-hooks/node_modules/eslint-config-airbnb-typescript/index.js
Referenced from:

Node 12、14、15都不行。不是很确定为何sylvanas需要在运行过程中跑一个非常严格的eslint,而且自身没有对应的deps