繁体   English   中英

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

[英]NPM install current application globally (e.g. npm install -g .)

我正在开发一个 package,它意味着要在全球范围内使用,我想在发布之前在全球范围内安装它。

我尝试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 package 上进行了尝试,我正在研究的结果都相同。 我创建了一个新的 package 并且它确实有效,失败的模块是否有些奇怪(我也看到了具有相同错误的绑定、nan 和 fsevents)

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

任何帮助,将不胜感激。

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

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM