Hyperledger Composer安装问题:安装CLI及开发工具遇npm弃用警告
Hey there, don’t stress too much about these warnings—they’re mostly npm’s way of flagging outdated dependencies that the Hyperledger Composer CLI relies on, not immediate showstoppers. Let’s break down each one and talk about how to handle them:
fs-promise@1.0.0Deprecation:npm WARN deprecated fs-promise@1.0.0: 使用mz或fs-extra^3.0版本以支持Promise
This old package for promise-based file system operations has been replaced by more reliable alternatives. If you’re not directly usingfs-promisein your own code, this is just a downstream dependency of the Composer CLI. To fix it, you can installfs-extra@^3.0ormzin your project directory—npm will prioritize these updated packages over the deprecated one where possible.crypto@0.0.3Deprecation:npm WARN deprecated crypto@0.0.3: 该包不再受支持,现已成为Node内置模块,若依赖crypto请切换至内置版本
The standalonecryptonpm package is obsolete because Node.js now includes a fully maintainedcryptomodule natively. The Composer CLI is probably relying on an older dependency that still references this outdated package. You don’t need to install anything extra here—future updates to the Composer CLI should automatically switch to using Node’s built-incryptomodule.jade@1.11.0Deprecation:npm WARN deprecated jade@1.11.0: Jade已更名为pug,请安装最新版本的pug替代jade
Jade was rebranded to Pug years ago. This warning comes from a dependency of the Composer CLI that hasn’t been updated yet. You can install the latestpugpackage in your project to suppress the warning, but keep in mind the Composer CLI might still referencejadeinternally—full resolution would require an upstream update from the Hyperledger team.
Quick Tips to Manage These Warnings:
- Update the Composer CLI: Run
npm update -g composer-clito check for a newer version of the CLI that might have already swapped out these deprecated dependencies. - Ignore Temporarily If It Works: If your CLI is functioning as expected after installation, these warnings are just informational—you can keep using your setup until you’re ready to update.
- Trace Dependency Chains: Use
npm ls <package-name>(e.g.,npm ls jade) to see exactly which package is pulling in the deprecated module, if you want to dig deeper.
内容的提问来源于stack exchange,提问作者Swap

