1

当我安装nodemon

sudo npm i --save-dev nodemon

我收到以下错误消息:

npm ERR! path /home/dominikpatera/Dropbox/Projekty/Fytwa/server/node_modules/npm/node_modules/abbrev
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/home/dominikpatera/Dropbox/Projekty/Fytwa/server/node_modules/npm/node_modules/abbrev' -> '/home/dominikpatera/Dropbox/Projekty/Fytwa/server/node_modules/npm/node_modules/.abbrev.DELETE'
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/dominikpatera/.npm/_logs/2018-07-11T09_45_21_545Z-debug.log

你能帮我修一下吗?

4

2 回答 2

6

打开终端并输入:

sudo npm install -g nodemon

然后

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

您将获得类似于以下内容的输出:

fs.inotify.max_user_watches=524288
fs.inotify.max_user_watches = 524288

之后,您的 nodemon 将完美运行。

于 2018-08-08T11:31:25.977 回答
0

首先确保在您的终端上,您正在处理正确的项目。您可以通过键入来检查这一点ls,然后按 Enter。

然后给出安装nodemon的命令。从nodemon的官网,我们发现,我们要写npm install -g nodemon

但是,如果您在这里遇到问题,请写下-

sudo npm install -g nodemon

于 2021-12-27T15:29:38.680 回答