部署nodejs环境碰到的一些坑,[nodemon] Internal watch failed: watch /usr/src/app/app ENOSPC

启动node的时候出现如下提升:

[nodemon] Internal watch failed: watch /usr/src/app/app ENOSPC

解决办法是在终端输入如下命令,然后重新运行

echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

或者

sudo sysctl fs.inotify.max_user_watches=582222 && sudo sysctl -p

该命令行的意思是将系统当前用户下允许监视的文件数量增加到一定数值。默认情况下该值比较低,而nodemon往往会监视大量的文件和目录,所以我们需要通过这行命令来修改这个值。

> react-antd-hrm@2.2.0 test2 /usr/src/app
> NODE_ENV=test2 DEBUG=1 SWAGGER=online nodemon --exec babel-node --harmony app/server.js

[nodemon] 1.18.11
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /usr/src/app/app/**/* webpack.config.js webpack server.js server_old.js server_new.js server_old_dev.js webpack.config.prod.js webpack.config.prod.dev.js
[nodemon] starting `babel-node --harmony app/server.js`
[nodemon] Internal watch failed: watch /usr/src/app/app ENOSPC

npm ERR! Linux 3.10.0-514.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "test2"
npm ERR! node v6.17.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! react-antd-hrm@2.2.0 test2: `NODE_ENV=test2 DEBUG=1 SWAGGER=online nodemon --exec babel-node --harmony app/server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the react-antd-hrm@2.2.0 test2 script 'NODE_ENV=test2 DEBUG=1 SWAGGER=online nodemon --exec babel-node --harmony app/server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-antd-hrm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=test2 DEBUG=1 SWAGGER=online nodemon --exec babel-node --harmony app/server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-antd-hrm
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-antd-hrm
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/npm-debug.log

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值