両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン |
javascript:pnpm [2024/10/08 15:10] – [Farm (Rust で書かれた超高速 Web ビルド ツール) + React の開始手順] ともやん | javascript:pnpm [2025/04/27 08:07] (現在) – [ERROR This project is configured to use yarn が発生する...🤪] ともやん |
---|
</pre></html></WRAP> | </pre></html></WRAP> |
<WRAP color_result><html><pre> | <WRAP color_result><html><pre> |
<font color="#12488B"><b>==></b></font><b> Downloading pnpm binaries 9.8.0</b> | <font color="#2A7BDE"><b>==></b></font><b> Downloading pnpm binaries 10.7.0</b> |
<span style="background-color:#A2734C"><font color="#171421"> WARN </font></span> using --force I sure hope you know what you are doing | <span style="background-color:#A2734C"><font color="#171421"> WARN </font></span> using --force I sure hope you know what you are doing |
Copying pnpm CLI from /tmp/tmp.mOCIb0d59q/pnpm to /home/tomoyan/.local/share/pnpm/pnpm | Copying pnpm CLI from /tmp/tmp.RRyn6TVWxM/pnpm to /home/tomoyan/.local/share/pnpm/pnpm |
Appended new lines to /home/tomoyan/.zshrc | Appended new lines to /home/tomoyan/.zshrc |
| |
</pre></html></WRAP> | </pre></html></WRAP> |
</WRAP> | </WRAP> |
| |
| 動作確認...😉\\ |
| <WRAP color_term> |
| <WRAP color_command><html><pre> |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">pnpm</font> <font color="#A347BA">-v</font> |
| </pre></html></WRAP> |
| <WRAP color_result><html><pre> |
| 10.7.0 |
| </pre></html></WRAP> |
| </WRAP> |
| |
| 使い方🤔\\ |
| <WRAP color_term> |
| <WRAP color_command><html><pre> |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">pnpm</font> <font color="#A347BA">-h</font> |
| </pre></html></WRAP> |
| <WRAP color_result_long><html><pre> |
| Version 10.6.1 (compiled to binary; bundled Node.js v20.11.1) |
| Usage: pnpm [command] [flags] |
| pnpm [ -h | --help | -v | --version ] |
| |
| Manage your dependencies: |
| add Installs a package and any packages that it depends on. By default, any new package is |
| installed as a prod dependency |
| import Generates a pnpm-lock.yaml from an npm package-lock.json (or npm-shrinkwrap.json) file |
| i, install Install all dependencies for a project |
| it, install-test Runs a pnpm install followed immediately by a pnpm test |
| ln, link Connect the local project to another one |
| prune Removes extraneous packages |
| rb, rebuild Rebuild a package |
| rm, remove Removes packages from node_modules and from the project's package.json |
| unlink Unlinks a package. Like yarn unlink but pnpm re-installs the dependency after removing |
| the external link |
| up, update Updates packages to their latest version based on the specified range |
| |
| Review your dependencies: |
| audit Checks for known security issues with the installed packages |
| licenses Check licenses in consumed packages |
| ls, list Print all the versions of packages that are installed, as well as their dependencies, |
| in a tree-structure |
| outdated Check for outdated packages |
| |
| Run your scripts: |
| exec Executes a shell command in scope of a project |
| run Runs a defined package script |
| start Runs an arbitrary command specified in the package's "start" property of its "scripts" |
| object |
| t, test Runs a package's "test" script, if one was provided |
| |
| Other: |
| cat-file Prints the contents of a file based on the hash value stored in the index file |
| cat-index Prints the index file of a specific package from the store |
| find-hash Experimental! Lists the packages that include the file with the specified hash. |
| pack Create a tarball from a package |
| publish Publishes a package to the registry |
| root Prints the effective modules directory |
| |
| Manage your store: |
| store add Adds new packages to the pnpm store directly. Does not modify any projects or files |
| outside the store |
| store path Prints the path to the active store directory |
| store prune Removes unreferenced (extraneous, orphan) packages from the store |
| store status Checks for modified packages in the store |
| |
| Options: |
| -r, --recursive Run the command for each project in the workspace. |
| </pre></html></WRAP> |
| </WRAP> |
| |
| |
公式: [[https://pnpm.io/ja/cli/env|pnpm env <cmd> | pnpm]]\\ | 公式: [[https://pnpm.io/ja/cli/env|pnpm env <cmd> | pnpm]]\\ |
</pre></html></WRAP> | </pre></html></WRAP> |
<WRAP color_result><html><pre> | <WRAP color_result><html><pre> |
Fetching Node.js 20.17.0 ... | Fetching Node.js 22.14.0 ... |
Node.js 20.17.0 was installed | Node.js 22.14.0 was installed |
/home/tomoyan/.local/share/pnpm/nodejs/20.17.0 | /home/tomoyan/.local/share/pnpm/nodejs/22.14.0 |
All specified Node.js versions were installed | All specified Node.js versions were installed |
</pre></html></WRAP> | </pre></html></WRAP> |
</pre></html></WRAP> | </pre></html></WRAP> |
<WRAP color_result><html><pre> | <WRAP color_result><html><pre> |
Node.js 20.17.0 was installed | Node.js 22.14.0 was installed |
/home/tomoyan/.local/share/pnpm/nodejs/20.17.0 | /home/tomoyan/.local/share/pnpm/nodejs/22.14.0 |
Node.js 20.17.0 was activated | Node.js 22.14.0 was activated |
/home/tomoyan/.local/share/pnpm/node -> /home/tomoyan/.local/share/pnpm/nodejs/20.17.0/bin/node | /home/tomoyan/.local/share/pnpm/node -> /home/tomoyan/.local/share/pnpm/nodejs/22.14.0/bin/node |
</pre></html></WRAP> | </pre></html></WRAP> |
</WRAP> | </WRAP> |
</WRAP> | </WRAP> |
===== トラブルシューティング ===== | ===== トラブルシューティング ===== |
| |
| ==== ERR_PNPM_UNEXPECTED_STORE Unexpected store location が発生する...🤪 ==== |
| 参考: [[git>pnpm/pnpm/issues/3584|Can't install dependencies when one of them is linked from global · Issue #3584 · pnpm/pnpm]]\\ |
| <WRAP color_term> |
| <WRAP color_command><html><pre> |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">pnpm</font> install <font color="#A347BA">-g</font> web-ext |
| </pre></html></WRAP> |
| <WRAP color_result><html><pre> |
| <span style="background-color:#C01C28"><font color="#171421"> ERR_PNPM_UNEXPECTED_STORE </font></span> <font color="#C01C28">Unexpected store location</font> |
| |
| The dependencies at "/home/tomoyan/.local/share/pnpm/global/5/node_modules" are currently linked from the store at "/home/tomoyan/.local/share/pnpm/store/v10". |
| |
| pnpm now wants to use the store at "/home/tomoyan/.pnpm-store/v10" to link dependencies. |
| |
| If you want to use the new store location, reinstall your dependencies with "pnpm install". |
| |
| You may change the global store location by running "pnpm config set store-dir <dir> --global". |
| (This error may happen if the node_modules was installed with a different major version of pnpm) |
| </pre></html></WRAP> |
| </WRAP> |
| |
| <WRAP color_term> |
| <WRAP color_command><html><pre> |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">pnpm</font> link <font color="#A347BA">--global</font> |
| </pre></html></WRAP> |
| <WRAP color_result><html><pre> |
| <font color="#26A269">✔</font> <b>The modules directory at "/home/tomoyan/.local/share/pnpm/global/5/node_modules" will be removed and reinstalled from scratch. Proceed?</b> (Y/n) · <font color="#26A269">true</font> |
| |
| Recreating /home/tomoyan/.local/share/pnpm/global/5/node_modules |
| Downloading zeromq@6.3.0: <font color="#33C7DE">6.99 MB</font>/<font color="#33C7DE">6.99 MB</font>, done |
| Downloading @tslab/typescript-for-tslab@5.0.4: <font color="#33C7DE">7.05 MB</font>/<font color="#33C7DE">7.05 MB</font>, done |
| <span style="background-color:#A2734C"><font color="#171421"> WARN </font></span> <font color="#C01C28">6 deprecated subdependencies found:</font> are-we-there-yet@3.0.1, gauge@4.0.4, glob@7.2.3, inflight@1.0.6, npmlog@6.0.2, sourcemap-codec@1.4.8 |
| Progress: resolved <font color="#33C7DE">206</font>, reused <font color="#33C7DE">96</font>, downloaded <font color="#33C7DE">109</font>, added <font color="#33C7DE">0</font>, done |
| <span style="background-color:#A2734C"><font color="#171421"> WARN </font></span> paxmod has no binaries |
| |
| <font color="#33C7DE">/home/tomoyan/.local/share/pnpm/global/5:</font> |
| <font color="#26A269">+</font> grunt-cli <font color="#666666">1.5.0</font> |
| <font color="#26A269">+</font> paxmod <font color="#666666"><- ../../../../../my_projects/jupyter-src/paxmod</font> |
| <font color="#26A269">+</font> tslab <font color="#666666">1.0.22</font> |
| </pre></html></WRAP> |
| <WRAP color_command><html><pre> |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">pnpm</font> install <font color="#A347BA">-g</font> web-ext |
| </pre></html></WRAP> |
| <WRAP color_result><html><pre> |
| <span style="background-color:#A2734C"><font color="#171421"> WARN </font></span> <font color="#C01C28">10 deprecated subdependencies found:</font> @humanwhocodes/config-array@0.13.0, @humanwhocodes/object-schema@2.0.3, are-we-there-yet@3.0.1, eslint@8.57.1, gauge@4.0.4, glob@7.2.3, inflight@1.0.6, npmlog@6.0.2, rimraf@3.0.2, sourcemap-codec@1.4.8 |
| Packages: <font color="#26A269">+309</font> |
| <font color="#26A269">++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</font> |
| Progress: resolved <font color="#33C7DE">515</font>, reused <font color="#33C7DE">331</font>, downloaded <font color="#33C7DE">183</font>, added <font color="#33C7DE">309</font>, done |
| |
| <font color="#33C7DE">/home/tomoyan/.local/share/pnpm/global/5:</font> |
| <font color="#26A269">+</font> web-ext <font color="#666666">8.6.0</font> |
| |
| <font color="#A2734C">╭ Warning ──────────────────────────────────────────────────────────────────────────────────────╮</font> |
| <font color="#A2734C">│</font> <font color="#A2734C">│</font> |
| <font color="#A2734C">│</font> Ignored build scripts: spawn-sync. <font color="#A2734C">│</font> |
| <font color="#A2734C">│</font> Run "pnpm approve-builds -g" to pick which dependencies should be allowed to run scripts. <font color="#A2734C">│</font> |
| <font color="#A2734C">│</font> <font color="#A2734C">│</font> |
| <font color="#A2734C">╰───────────────────────────────────────────────────────────────────────────────────────────────╯</font> |
| |
| Done in 2m 8.9s using pnpm v10.9.0 |
| </pre></html></WRAP> |
| <WRAP color_command><html><pre> |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">pnpm</font> approve-builds <font color="#A347BA">-g</font> |
| </pre></html></WRAP> |
| <WRAP color_result><html><pre> |
| ✔ Choose which packages to build (Press <font color="#2AA1B3"><space></font> to select, <font color="#2AA1B3"><a></font> to toggle all, <font color="#2AA1B3"><i></font> to invert selection) · <font color="#A347BA">No items were selected</font> |
| </pre></html></WRAP> |
| </WRAP> |
| |
| ==== ERROR This project is configured to use yarn が発生する...🤪 ==== |
| バージョンすらわからない😅\\ |
| <WRAP color_term> |
| <WRAP color_command><html><pre> |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">pnpm</font> <font color="#A347BA">-v</font> |
| </pre></html></WRAP> |
| <WRAP color_result><html><pre> |
| <span style="background-color:#C01C28"><font color="#171421">ERROR </font></span> <font color="#C01C28">This project is configured to use yarn</font> |
| For help, run: pnpm help |
| </pre></html></WRAP> |
| </WRAP> |
| |
| ヘルプを見ようにも見られない😇\\ |
| <WRAP color_term> |
| <WRAP color_command><html><pre> |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">pnpm</font> <font color="#A347BA">-h</font> |
| </pre></html></WRAP> |
| <WRAP color_result><html><pre> |
| <span style="background-color:#C01C28"><font color="#171421">ERROR </font></span> <font color="#C01C28">This project is configured to use yarn</font> |
| For help, run: pnpm help help |
| </pre></html></WRAP> |
| </WRAP> |
| |
| ホームディレクトリのプロジェクト package.json は、yarn を使用するように構成されているので一時的に退避する😉\\ |
| <WRAP color_term> |
| <WRAP color_command><html><pre> |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">mv</font> <u style="text-decoration-style:solid">~/package.json</u> ~/package.json.yarn |
| <font color="#0087FF"><b>$</b></font> <font color="#26A269">pnpm</font> <font color="#A347BA">-v</font> |
| </pre></html></WRAP> |
| <WRAP color_result><html><pre> |
| 10.6.1 |
| </pre></html></WRAP> |
| </WRAP> |
| |
| または、yarn から pnpm にマイグレーションする🤔\\ |
| [[dt>andreychernykh/yarn-npm-to-pnpm-migration-guide-2n04|How to migrate from yarn / npm to pnpm - DEV Community]] [[gtr>https://dev.to/andreychernykh/yarn-npm-to-pnpm-migration-guide-2n04|翻訳]]\\ |
| |
==== pnpm env add -g できない😅 ==== | ==== pnpm env add -g できない😅 ==== |