NPM run serve Error & NPM ERR! code ELIFECYCLE - Solution

cit246@cit246-ThinkPad-T430:~/Desktop/venkat/grafanacoreui$ npm run serve

> @coreui/coreui-free-vue-admin-template@3.0.0 serve /home/cit246/Desktop/venkat/grafanacoreui
> vue-cli-service serve

 INFO  Starting development server...10% building 2/2 modules 0 activeevents.js:298
      throw er; // Unhandled 'error' event
      ^

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/cit246/Desktop/venkat/grafanacoreui/public'
    at FSWatcher.start (internal/fs/watchers.js:169:26)
    at Object.watch (fs.js:1346:11)
    at createFsWatchInstance (/home/cit246/Desktop/venkat/grafanacoreui/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/home/cit246/Desktop/venkat/grafanacoreui/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/cit246/Desktop/venkat/grafanacoreui/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/cit246/Desktop/venkat/grafanacoreui/node_modules/chokidar/lib/nodefs-handler.js:429:19)
    at FSWatcher.<anonymous> (/home/cit246/Desktop/venkat/grafanacoreui/node_modules/chokidar/lib/nodefs-handler.js:477:19)
    at FSWatcher.<anonymous> (/home/cit246/Desktop/venkat/grafanacoreui/node_modules/chokidar/lib/nodefs-handler.js:482:16)
    at FSReqCallback.oncomplete (fs.js:167:5)
Emitted 'error' event on FSWatcher instance at:    at FSWatcher._handleError (/home/cit246/Desktop/venkat/grafanacoreui/node_modules/chokidar/index.js:260:10)
    at createFsWatchInstance (/home/cit246/Desktop/venkat/grafanacoreui/node_modules/chokidar/lib/nodefs-handler.js:40:5)
    at setFsWatchListener (/home/cit246/Desktop/venkat/grafanacoreui/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    [... lines matching original stack trace ...]
    at FSReqCallback.oncomplete (fs.js:167:5) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/home/cit246/Desktop/venkat/grafanacoreui/public',
  filename: '/home/cit246/Desktop/venkat/grafanacoreui/public'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @coreui/coreui-free-vue-admin-template@3.0.0 serve: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @coreui/coreui-free-vue-admin-template@3.0.0 serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/cit246/.npm/_logs/2020-04-02T13_35_37_958Z-debug.log




Method-1:


When I face this issues on my project,I just cut the package.json file and run npm install

cit246@cit246-ThinkPad-T430:~/Desktop/venkat/grafanacoreui$ npm install
 

npm WARN saveError ENOENT: no such file or directory, open '/home/cit246/Desktop/venkat/grafanacoreui/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/cit246/Desktop/venkat/grafanacoreui/package.json'
npm WARN grafanacoreui No description
npm WARN grafanacoreui No repository field.
npm WARN grafanacoreui No README data
npm WARN grafanacoreui No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/babel-jest/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 3691114 packages in 37.114s

46 packages are looking for funding
  run `npm fund` for details

found 3585 vulnerabilities (3498 low, 85 moderate, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details

After completed again past that Package.json as in previous place and Run npm run serve



Method-2:

Running this code in terminal on ubuntu 16.04 and i have solved my problem
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p



and finally run -:  npm run serve

Comments

Popular posts from this blog

How to Connect Firebase Using Pyrebase In Python

How to get Full URL or get absolute url In Django

How To Convert Html File/URL/String Into Image Using Python