nvm npm不是内部命令_npm作弊表-最常见的命令和nvm

nvm npm不是内部命令

npm or the Node Package Manager, is one of the most used tools for any Node.js developer. Here's a list of the most common commands you'll use when working with npm.

npm或Node Package Manager是Node.js开发人员最常用的工具之一。 这是使用npm时将使用的最常见命令的列表。

安装package.json依赖项 (Install package.json dependencies)

npm install

速记 (Shorthand)

# install
npm i <package>

# uninstall
npm un <package>

# update
npm up <package>

标志 (Flags)

-S is the same as --save, and -D is the same as --save-dev.

-S--save相同, -D--save-dev相同。

列出全局安装的软件包 (List globally installed packages)

npm list -g --depth=0

卸载全局软件包 (Uninstall global package)

npm -g uninstall <name>

在Windows上升级npm (Upgrade npm on Windows)

npm-windows-upgrade

更新全局软件包 (Update global packages)

To see which packages need updating, use:

要查看哪些软件包需要更新,请使用:

npm outdated -g --depth=0

To update global packages individually you can use:

要单独更新全局软件包,可以使用:

npm update -g <package> <package> <package>

列出要运行的可用脚本 (list available scripts to run)

npm run

更新npm (Update npm)

npm install -g npm@latest

# using windows? Then use
npm-windows-upgrade

安装版本 (Installed version)

npm list # for local packages

节点版本管理器nvm (Node Version Manager nvm)

nvm makes it easy to switch between different versions of Node.js. Read more about it on the project's GitHub page.

nvm可以轻松地在不同版本的Node.js之间切换。 在该项目的GitHub页面上阅读有关它的更多信息。

Once you have nvm installed, if you want to install the latest version of Node v12 just run:

安装nvm ,如果要安装最新版本的Node v12,请运行:

nvm install 12

If you have multiple versions of Node.js installed on your workspace, you can switch to a specific version by writing:

如果您的工作空间上安装了多个版本的Node.js,则可以通过以下方式切换到特定版本:

nvm use 10.19.0

将节点版本设为默认 (Make a Node version default)

In order to set a default version of Node for your workspace, just type:

为了为您的工作区设置默认版本的Node,只需键入:

nvm alias default 12

Where the latest version of 12 is the version you want to be used by default.

其中最新版本的12是默认情况下要使用的版本。

更新npm (Update npm)

If you use Node installed through nvm, it's good practice to update your version of npm with this command:

如果您使用通过nvm安装的nvm ,则最好使用以下命令来更新npm版本:

nvm install-latest-npm

更多信息: (More information:)

翻译自: https://www.freecodecamp.org/news/npm-cheat-sheet-most-common-commands-and-nvm/

nvm npm不是内部命令

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值