NPM全局安装当前应用程序(例如npm install -g。)

问题描述 投票:0回答:1

我正在开发一个打算在全球范围内使用的软件包,我想在发布之前在全球范围内安装它。

我尝试过use npm i -g .,但由于找不到文件而总是失败

npm ERR! code ENOENT
npm ERR! syscall access
npm ERR! path /home/ivan/lux2/cli/node_modules/file-uri-to-path
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, access '/home/ivan/lux2/cli/node_modules/file-uri-to-path'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ivan/.npm/_logs/2020-04-29T01_38_22_536Z-debug.log

我已经在我正在使用的几个不同的全局npm软件包上尝试过,但都具有相同的结果。我创建了一个新程序包,它确实起作用了,关于失败的模块是否有些怪异(我也看到了具有相同错误的绑定,nan和fsevents)

如果我尝试创建那些目录(它们不在我的依赖性中),我最终会发现更多丢失的目录。

任何帮助将不胜感激。

node.js npm npm-install
1个回答
0
投票

确保您在正确的路径中运行此命令,并尝试像这样运行命令-npm install libraryName -g

© www.soinside.com 2019 - 2024. All rights reserved.