简体   繁体   English

在 IBM Power System i 上运行 Nodemon

[英]Running Nodemon on IBM Power System i

I am new to node development on power system i, was trying to get nodemon to work but errors out with following:我是电力系统 i 上节点开发的新手,试图让 nodemon 工作但出现以下错误:

# nodemon.js

[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
[nodemon] Internal watch failed: watch ENOSYS

My application uses express, ejs and body-parser, works well outside of nodemon.我的应用程序使用 express、ejs 和 body-parser,在 nodemon 之外运行良好。 First off, I couldn't get nodemon to be installed globally so I put that on my application node_modules directory and set the path, which is not what I usually do in other environments.首先,我无法全局安装 nodemon,所以我将其放在我的应用程序 node_modules 目录中并设置路径,这不是我通常在其他环境中所做的。 How does npm install -g suppose to work on system i? npm install -g应该如何在系统 i 上工作? Any help on this greatly appreciated!非常感谢任何帮助! Thanks!谢谢!

My environment is:我的环境是:

(node: v6.9.1)
(npm:3.10.8)
(OS:  V7R1)
Path: /QOpenSys/QIBM/ProdData/OPS/Node6/bin:/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin:/home/QSECOFR/projects/mytasklist/node_modules/nodemon/bin
LIBPath: /QOpenSys/QIBM/ProdData/OPS/Node6/bin:/home/QSECOFR/projects/mytasklist/node_modules/nodemon/bin

After days of searching, I think I found a solution.经过几天的搜索,我想我找到了解决办法。 I wasn't able to run directly Nodemon by typing我无法通过键入直接运行 Nodemon

nodemon src/app.js

So on Node14 I found a workaround, adding a script line in package.json所以在 Node14 上我找到了一个解决方法,在 package.json 中添加一个脚本行

 ... ,
  "main": "./src/app.js",
  "scripts": {
    ...,
    "serve": "nodemon -L"
  },

Then run your application by typing npm run serve然后通过键入npm run serve运行您的应用程序

And voilà !瞧!

It seems to run in legacy mode.它似乎以传统模式运行。

Note: In node 10 this worked too (but not in node 14) even if my main file is src/app.js注意:在节点 10 中这也有效(但在节点 14 中无效)即使我的主文件是 src/app.js

"serve": "nodemon server.js"

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

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