用于全局模块安装的package.json [英] package.json for global module installation
问题描述
我有一个package.json,其中必须全局安装一些模块,下面是我在依赖项下面添加的部分
I have a package.json in which some modules have to be installed globally,below is the part that i added below dependencies
"scripts": {
"preinstall": "npm i -g supervisor",
"preinstall": "npm i -g forever"
}
但是当我运行npm install时,出现如下错误
But when i ran npm install i got the error as below
npm WARN package.json aaa@0.0.0 No README.md file found!
npm WARN cannot run in wd aaa@0.0.0 npm i -g forever (wd=/home/administrator/AAA)
所有要在本地安装的模块都已安装,但只有整体安装会引发错误.我被困在这里,将不胜感激任何帮助.
All the modules to be installed locally are getting installed,but only gloal installation is throwing an error.I am stuck here any help will be much appreciated.
推荐答案
将此放在您的package.json中:
Put this in your package.json :
"config":{
"unsafe-perm":true
}
然后将模块安装为root
.
我还认为,开关preferGlobal
:文档是为喜欢的模块创建的在全球范围内安装.您可能需要更改程序逻辑以以编程方式使用forever
模块.
Also I think that the switch preferGlobal
: Documentation, is created for modules that prefer to be installed globally. You might want to change your program logic to use programatically forever
module.
这篇关于用于全局模块安装的package.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!