简体   繁体   English

npm install -g正在安装到本地文件夹

[英]npm install -g is installing to a local folder

I have been using node and npm for a while, and I just started a larger scale project using it. 我已经使用节点和npm已有一段时间了,而我刚刚开始使用它进行较大规模的项目。 Recently, however, whenever I run sudo npm install -g , it will install it into a ~/Programming/usr/local/bin instead of /usr/local/bin . 但是,最近,每当我运行sudo npm install -g ,它将安装到~/Programming/usr/local/bin而不是/usr/local/bin Does anyone know why this is happening? 有人知道为什么会这样吗? How can I reset the installation location 如何重置安装位置

您可以通过运行以下命令来设置位置。

npm config set prefix /usr/local

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从本地文件夹安装 npm 模块? - How to install npm module from local folder? 安装并访问本地文件夹作为npm模块 - Install & access a local folder as a npm module 安装 firebase `npm install -g firebase-tools` 时出错 - error installing firebase `npm install -g firebase-tools` 为什么 npm 安装不安装包到 /node_modules 文件夹? - Why is npm install not installing packages into /node_modules folder? `npm install`没有安装本地软件包的子依赖项 - `npm install` is not installing local package's sub-dependencies npm install vs sudo npm install -g - npm install vs sudo npm install -g 在 Mac 上使用命令 'sudo npm install electron -g' 在 Mac 上安装 Electron 后如何修复此错误 - How can I fix this error after installing Electron on Mac with command 'sudo npm install electron -g' npm install handlebars -g错误 - npm install handlebars -g ERRORS npm 安装-g @sanity/cli npm 错误:代码 EPERM npm 错误! 系统调用 mkdir npm 错误! 路径 C:\Program Files\Git\usr\local npm 错误! 错误号-4048 - npm install -g @sanity/cli npm ERR! code EPERM npm ERR! syscall mkdir npm ERR! path C:\Program Files\Git\usr\local npm ERR! errno -4048 通过npm install安装时出错 - Error installing via npm install
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM