Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm 无法安装吗? #279

Open
Brantfang opened this issue Jan 22, 2024 · 4 comments
Open

pnpm 无法安装吗? #279

Brantfang opened this issue Jan 22, 2024 · 4 comments

Comments

@Brantfang
Copy link

pnpm i @next-theme/plugins

 WARN  Issues with peer dependencies found
.
└─┬ @next-theme/plugins 8.19.1
  ├─┬ disqusjs 3.0.2
  │ ├── ✕ missing peer react@"^16.11.0 || ^17.0.0 || ^18.0.0"
  │ ├── ✕ unmet peer preact@^10.7.1: found 8.1.0
  │ └─┬ zustand 4.5.0
  │   ├── ✕ missing peer react@>=16.8
  │   └─┬ use-sync-external-store 1.2.0
  │     └── ✕ missing peer react@"^16.8.0 || ^17.0.0 || ^18.0.0"
  ├─┬ gitalk 1.8.0
  │ └─┬ react-flip-move 2.9.14
  │   ├── ✕ missing peer react@"0.13.x || 0.14.x || 15.x.x"
  │   └── ✕ missing peer react-dom@"0.13.x || 0.14.x || 15.x.x"
  └─┬ quicklink 2.3.0
    ├── ✕ missing peer react@^16.8.0
    └── ✕ missing peer react-dom@^16.8.0
✕ Conflicting peer dependencies:
  react
  react-dom

Done in 1.7s
Progress: resolved 556, reused 555, downloaded 0, added 0, done

pnpm hexo g

INFO  Validating config
NexT version 8.19.1
Documentation: https://theme-next.js.org
========================================
INFO  Start processing
WARN  The following packages are not found by `@next-theme/plugins`.
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/animejs'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/@fortawesome/fontawesome-free'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/mathjax'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/katex'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/@next-theme/pjax'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/@fancyapps/ui'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/medium-zoom'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/lozad'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/pangu'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/quicklink'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/disqusjs'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/gitalk'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/firebase'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/algoliasearch'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/instantsearch.js'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/hexo-generator-searchdb'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/pdfobject'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/mermaid'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/animate.css'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/pace-js'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/ribbon.js'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/@creativecommons/vocabulary'
WARN  ENOENT: no such file or directory, stat 'D:\learn\gitRep\blog\node_modules\/wavedrom'
WARN  Maybe you can find the solution here: https://github.com/next-theme/plugins#debug
INFO  Files loaded in 315 ms

package.json 的依赖

"dependencies": {
    "@next-theme/plugins": "^8.19.1",
    "hexo": "^7.1.0",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^6.0.0",
    "hexo-renderer-stylus": "^3.0.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-next": "^8.19.1"
  }
@Brantfang
Copy link
Author

Brantfang commented Jan 23, 2024

ignore peer

{
 "pnpm": {
     "peerDependencyRules": {
       "ignoreMissing": ["react", "react-dom","preact"]
     }
  }
}

pnpm i --shamefully-hoist

My solution, is there a better solution for pnpm installation?

@stevenjoezhang
Copy link
Member

Conflicting peer dependencies这个倒不是直接有影响的,主要问题是pnpm默认的包安装路径和npm不一样,需要单独适配,不然这个插件没法找到前端库文件的路径

@Brantfang
Copy link
Author

Conflicting peer dependencies这个倒不是直接有影响的,主要问题是pnpm默认的包安装路径和npm不一样,需要单独适配,不然这个插件没法找到前端库文件的路径

pnpm i --shamefully-hoist 用这个参数平铺 node_module 目录可以用。但是不符合 pnpm 做法,最好 pnpm 可以读取配置文件指定参数,以提升某个依赖中所有依赖到 node_module(只需要创建软链接即可)。

@stevenjoezhang
Copy link
Member

感谢,我研究一下,看看下个版本能不能适配上

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants