javascript – Angular 2 quickstart ENOSPC错误

前端之家收集整理的这篇文章主要介绍了javascript – Angular 2 quickstart ENOSPC错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在试用官方 5 Min Quickstart关于角度2的Typescript.我遵循所有步骤,当我运行npm开始它确实在我的Firefox浏览器弹出预期的我的第一个Angular 2应用程序消息.

但是,当我检查控制台时,我发现错误消息:

  1. Error: watch node_modules/angular2/es6/dev/src/common/directives/ng_if.js ENOSPC

当我在项目的根文件夹下运行npm安装时,我不知道是否与我之前收到的警告消息相关:

  1. npm WARN install Couldn't install optional dependency: Unsupported
  2. npm WARN EPACKAGEJSON angular2-quickstart@1.0.0 No description
  3. npm WARN EPACKAGEJSON angular2-quickstart@1.0.0 No repository field.

有人可以告诉我我的做法有什么问题吗?更详细的控制台输出如下所示:

  1. > angular2-quickstart@1.0.0 start /home/ubuntu/jsProjects/angular2-quickstart
  2. > concurrent "npm run tsc:w" "npm run lite"
  3.  
  4. [0]
  5. [0] > angular2-quickstart@1.0.0 tsc:w /home/ubuntu/jsProjects/angular2-quickstart
  6. [0] > tsc -w
  7. [0]
  8. [1]
  9. [1] > angular2-quickstart@1.0.0 lite /home/ubuntu/jsProjects/angular2-quickstart
  10. [1] > lite-server
  11. [1]
  12. [1] [BS] Access URLs:
  13. [1] ----------------------------------
  14. [1] Local: http://localhost:3000
  15. [1] External: http://10.0.0.17:3000
  16. [1] ----------------------------------
  17. [1] UI: http://localhost:3001
  18. [1] UI External: http://10.0.0.17:3001
  19. [1] ----------------------------------
  20. [1] [BS] Serving files from: ./
  21. [1] [BS] Watching files...
  22. [1] 15.12.19 08:14:48 304 GET /./index.html (Unknown - 59ms)
  23. [1] 15.12.19 08:14:49 304 GET /node_modules/es6-shim/es6-shim.js (Unknown - 729ms)
  24. [1] 15.12.19 08:14:49 304 GET /node_modules/angular2/bundles/angular2-polyfills.js (Unknown - 205ms)
  25. [1] 15.12.19 08:14:49 304 GET /node_modules/systemjs/dist/system.src.js (Unknown - 204ms)
  26. [1] 15.12.19 08:14:49 304 GET /node_modules/rxjs/bundles/Rx.js (Unknown - 204ms)
  27. [1] 15.12.19 08:14:49 304 GET /node_modules/angular2/bundles/angular2.dev.js (Unknown - 204ms)
  28. [0] 8:14:50 AM - Compilation complete. Watching for file changes.
  29. [1] [BS] File changed: app/app.component.js
  30. [1] [BS] File changed: app/boot.js
  31. [1] 15.12.19 08:14:51 200 GET /app/boot.js (Unknown - 92ms)
  32. [1] 15.12.19 08:14:52 200 GET /app/app.component.js (Unknown - 29ms)
  33. [1] events.js:141
  34. [1] throw er; // Unhandled 'error' event
  35. [1] ^
  36. [1]
  37. [1] Error: watch node_modules/angular2/es6/dev/src/common/directives/ng_if.js ENOSPC
  38. [1] at exports._errnoException (util.js:855:11)
  39. [1] at FSWatcher.start (fs.js:1313:19)
  40. [1] at Object.fs.watch (fs.js:1341:11)
  41. [1] at createFsWatchInstance (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:37:15)
  42. [1] at setFsWatchListener (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
  43. [1] at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:228:14)
  44. [1] at FSWatcher.NodeFsHandler._handleFile (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:255:21)
  45. [1] at FSWatcher.<anonymous> (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:473:21)
  46. [1] at FSReqWrap.oncomplete (fs.js:82:15)
  47. [1]
  48. [1] npm ERR! Linux 3.19.0-41-generic
  49. [1] npm
  50. [1] ERR! argv "/opt/node-v5.3.0-linux-x64/bin/node" "/opt/node-v5.3.0-linux-x64/bin/npm" "run" "lite"
  51. [1] npm ERR! node v5.3.0
  52. [1] npm ERR! npm v3.3.12
  53. [1] npm ERR! code ELIFECYCLE
  54. [1] npm ERR! angular2-quickstart@1.0.0 lite: `lite-server`
  55. [1] npm ERR! Exit status 1
  56. [1] npm ERR!
  57. [1] npm ERR! Failed at the angular2-quickstart@1.0.0 lite script 'lite-server'.
  58. [1] npm ERR! Make sure you have the latest version of node.js and npm installed.
  59. [1] npm ERR! If you do,this is most likely a problem with the angular2-quickstart package,[1] npm ERR! not with npm itself.
  60. [1] npm ERR!
  61. [1] Tell the author that this fails on your system:
  62. [1] npm ERR! lite-server
  63. [1] npm ERR! You can get their info via:
  64. [1] npm ERR! npm owner ls angular2-quickstart
  65. [1] npm ERR! There is likely additional logging output above.
  66. [1]
  67. [1] npm ERR! Please include the following file with any support request:
  68. [1] npm ERR! /home/ubuntu/jsProjects/angular2-quickstart/npm-debug.log
  69. [1] npm run lite exited with code 1

解决方法

我通过增加知识观察者的数量解决这个问题:
  1. echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

猜你在找的JavaScript相关文章