博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
npm软件安装包_npm在哪里安装软件包?
阅读量:2505 次
发布时间:2019-05-11

本文共 1638 字,大约阅读时间需要 5 分钟。

npm软件安装包

Read the if you are starting out with npm, it’s going to go in a lot of the basic details of it.

如果您从npm入手,请阅读 ,其中将包含许多基本细节。

When you install a package using npm (or ), you can perform 2 types of installation:

使用npm (或 )安装软件包时,可以执行两种安装类型:

  • a local install

    本地安装
  • a global install

    全局安装

By default, when you type an npm install command, like:

默认情况下,当您键入npm install命令时,例如:

npm install lodash

the package is installed in the current file tree, under the node_modules subfolder.

该软件包安装在当前文件树的node_modules子文件夹下。

As this happens, npm also adds the lodash entry in the dependencies property of the present in the current folder.

发生这种情况时, npm还会在当前文件夹中存在的的dependencies属性中添加lodash条目。

A global installation is performed using the -g flag:

使用-g标志执行全局安装:

npm install -g lodash

When this happens, npm won’t install the package under the local folder, but instead, it will use a global location.

发生这种情况时,npm不会将软件包安装在本地文件夹下,而是使用一个全局位置。

Where, exactly?

到底在哪里?

The npm root -g command will tell you where that exact location is on your machine.

npm root -g命令将告诉您确切位置在您计算机上的哪个位置。

On macOS or Linux this location could be /usr/local/lib/node_modules. On Windows it could be C:\Users\YOU\AppData\Roaming\npm\node_modules

在macOS或Linux上,此位置可能是/usr/local/lib/node_modules 。 在Windows上,可能是C:\Users\YOU\AppData\Roaming\npm\node_modules

If you use nvm to manage Node.js versions, however, that location would differ.

但是,如果使用nvm管理Node.js版本,则该位置将有所不同。

I for example use nvm and my packages location was shown as /Users/flavio/.nvm/versions/node/v8.9.0/lib/node_modules.

例如,我使用nvm ,我的软件包位置显示为/Users/flavio/.nvm/versions/node/v8.9.0/lib/node_modules

翻译自:

npm软件安装包

转载地址:http://kxqgb.baihongyu.com/

你可能感兴趣的文章
Linux+Apache+PHP+MySQL服务器环境配置(CentOS篇)
查看>>
Linux下获取本机IP地址的代码
查看>>
(C#)调用Webservice,提示远程服务器返回错误(500)内部服务器错误
查看>>
flex布局
查看>>
python-----python的文件操作
查看>>
java Graphics2d消除锯齿,使字体平滑显示
查看>>
控件中添加的成员变量value和control的区别
查看>>
Spring Boot Docker 实战
查看>>
Div Vertical Menu ver3
查看>>
Git简明操作
查看>>
InnoDB为什么要使用auto_Increment
查看>>
课堂练习之买书打折最便宜
查看>>
定义函数
查看>>
网络虚拟化技术(二): TUN/TAP MACVLAN MACVTAP
查看>>
MQTT协议笔记之mqtt.io项目HTTP协议支持
查看>>
(转)jQuery中append(),prepend()与after(),before()的区别
查看>>
Tecplot: Legend和图像中 Dashed/Dash dot/Long dash 等虚线显示没有区别的问题
查看>>
win8 开发之旅(2) --连连看游戏开发 项目错误的总结
查看>>
视频转换工具ffmpeg
查看>>
一、 object c -基础学习第一天 如何定义一个类
查看>>