search
HomeWeb Front-endJS TutorialDetailed explanation of the steps to modify the path of npm global installation mode

This time I will bring you a detailed explanation of the path steps for modifying the npm global installation mode. What are the precautions for modifying the path of the npm global installation mode? The following is a practical case. Get up and take a look.

Before I formally write this article, I have to talk about a little history of blood and tears.

I just learned nodeJS not long ago, and I was wondering why the global installation module was not found in 'node installation directory/node_modules‘! Later, I carefully looked at the information after the installation was successful, and found out that it was automatically installed on the C drive. Oh my God, the C drive must not be used to store these things, so I went online to Baidu.

Method 1: (Arrived on Baidu, but it doesn’t work for me....)

Open 'nodejs installation directory/node_modules/npm/.npmrc' and modify this file to:

prefix = G:\nodejs\npm_global_modules

Okay, try npm install bootstrap -g. Is it installed in the specified directory?

If this method doesn’t work for you, you can try the second method!

Method 2:

1. Open Node.js Command prompt and execute npm config ls

So you can see clearly...

2. Modify the value of prefix: npm config set prefix *

It’s done~~~

Summary: A simple question, the reason why it was solved For most of the day, it boils down to a question of learning methods. If you encounter such a problem, check the help document npm help install or google to get the answer quickly. (Also, don’t be too resistant to English documents~~)

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

The command processing method cannot be found after Nodejs installs the module globally

Usage of vux uploader image upload component Tutorial

The above is the detailed content of Detailed explanation of the steps to modify the path of npm global installation mode. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
主题背景位于 Windows 11 中的什么位置?主题背景位于 Windows 11 中的什么位置?Aug 01, 2023 am 09:29 AM

Windows11具有如此多的自定义选项,包括一系列主题和壁纸。虽然这些主题以自己的方式是美学,但一些用户仍然想知道他们在Windows11上的后台位置。本指南将展示访问Windows11主题背景位置的不同方法。什么是Windows11默认主题背景?Windows11默认主题背景是一朵盛开的抽象宝蓝色花朵,背景为天蓝色。这种背景是最受欢迎的背景之一,这要归功于操作系统发布之前的预期。但是,操作系统还附带了一系列其他背景。因此,您可以随时更改Windows11桌面主题背景。主题背景存储在Windo

如何修复错误:在Java中找不到或加载主类如何修复错误:在Java中找不到或加载主类Oct 26, 2023 pm 11:17 PM

由于技术错误,无法播放此视频。(错误代码:102006)本指南提供了针对此常见问题的简单修复,并继续您的编码之旅。我们还将讨论Java错误的原因以及将来如何防止它。什么是Java中的“错误:找不到或加载主类”?Java是一种强大的编程语言,使开发人员能够创建广泛的应用程序。然而,它的多功能性和效率伴随着开发过程中可能发生的一系列常见错误。其中一个中断是错误:找不到或加载主类user_jvm_args.txt,当Java虚拟机(JVM)找不到主类来执行程序时会出现这种情况。此错误充当了障碍,甚至在

斜杠和反斜杠在文件路径中的不同使用斜杠和反斜杠在文件路径中的不同使用Feb 26, 2024 pm 04:36 PM

文件路径是操作系统中用于识别和定位文件或文件夹的字符串。在文件路径中,常见的有两种符号分隔路径,即正斜杠(/)和反斜杠()。这两个符号在不同的操作系统中有不同的使用方式和含义。正斜杠(/)是Unix和Linux系统中常用的路径分隔符。在这些系统中,文件路径是以根目录(/)为起始点,每个目录之间使用正斜杠进行分隔。例如,路径/home/user/Docume

epc+o模式是什么意思epc+o模式是什么意思Nov 09, 2022 am 10:54 AM

epc+o模式就是指设计、采购等等为一体的总承包框架,它是在epc里面引申出来的一些运营环节;即在建设期内时,总承包商除了要去承担传统意义上的设计任务以外,还要去包揽在运营期内的所有维护任务。该模式可以极大程度提高许多项目的运营效率,也可以迅速降低运营成本。

Win11系统中“我的电脑”路径有何不同?快速查找方法!Win11系统中“我的电脑”路径有何不同?快速查找方法!Mar 29, 2024 pm 12:33 PM

Win11系统中“我的电脑”路径有何不同?快速查找方法!随着Windows系统的不断更新,最新的Windows11系统也带来了一些新的变化和功能。其中一个常见的问题是用户在Win11系统中找不到“我的电脑”的路径,这在之前的Windows系统中通常是很简单的操作。本文将介绍Win11系统中“我的电脑”的路径有何不同,以及快速查找的方法。在Windows1

如何查找Linux系统中RPM文件的存储路径?如何查找Linux系统中RPM文件的存储路径?Mar 14, 2024 pm 04:42 PM

在Linux系统中,RPM(RedHatPackageManager)是一种常见的软件包管理工具,用于安装、升级和删除软件包。有时候我们需要找到某个已安装的RPM文件的存储路径,以便进行查找或者其他操作。下面将介绍在Linux系统中如何查找RPM文件的存储路径,同时提供具体的代码示例。首先,我们可以使用rpm命令来查找已安装的RPM包及其存储路径。打开

Python 3.x 中如何使用os.path模块获取文件路径的各个部分Python 3.x 中如何使用os.path模块获取文件路径的各个部分Jul 30, 2023 pm 02:57 PM

Python3.x中如何使用os.path模块获取文件路径的各个部分在日常的Python编程中,我们经常需要对文件路径进行操作,例如获取路径的文件名、文件目录、扩展名等等。在Python中,可以使用os.path模块来进行这些操作。本文将介绍如何使用os.path模块来获取文件路径的各个部分,以便更好地操作文件。os.path模块提供了一系

Linux内核源代码存放路径解析Linux内核源代码存放路径解析Mar 14, 2024 am 11:45 AM

Linux内核是一个开源的操作系统内核,其源代码存储在一个专门的代码仓库中。在本文中,我们将详细解析Linux内核源代码的存放路径,并通过具体的代码示例来帮助读者更好地理解。1.Linux内核源代码存放路径Linux内核源代码存储在一个名为linux的Git仓库中,该仓库托管在[https://github.com/torvalds/linux](http

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),