4

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"

   }

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.

4

2 回答 2

2

把它放在你的 package.json 中:

"config":{
    "unsafe-perm":true
}

并将您的模块安装为root.

另外我认为 switch preferGlobal: Documentation是为喜欢全局安装的模块创建的。您可能希望更改程序逻辑以使用编程forever模块。

于 2013-05-06T09:00:26.617 回答
0

在本地安装模块,然后通过本地node_modules目录中的 bin 文件夹执行它们

npm install -S forever
ls node_modules/.bin/

要启动您的应用程序,请执行

node_modules/.bin/forever start app.js
于 2013-05-06T15:24:45.890 回答