最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Angular 2 quickstart ENOSPC error - Stack Overflow

programmeradmin2浏览0评论

I'm trying out the official 5 Min Quickstart about angular 2 for Typescript. I followed all steps and when I run npm start it did pop up the expected My First Angular 2 App message on my firefox browser.

However, when I checked the console, I found error messages:

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

I don't know if it's related to the warning message I received earlier when I run npm install on the root folder of the project:

npm WARN install Couldn't install optional dependency: Unsupported
npm WARN EPACKAGEJSON [email protected] No description
npm WARN EPACKAGEJSON [email protected] No repository field.

Can someone tell me what's wrong my approach? A more detailed console output looks like this:

> [email protected] start /home/ubuntu/jsProjects/angular2-quickstart
> concurrent "npm run tsc:w" "npm run lite" 

[0] 
[0] > [email protected] tsc:w /home/ubuntu/jsProjects/angular2-quickstart
[0] > tsc -w
[0] 
[1] 
[1] > [email protected] lite /home/ubuntu/jsProjects/angular2-quickstart
[1] > lite-server
[1] 
[1] [BS] Access URLs:
[1]  ----------------------------------
[1]        Local: http://localhost:3000
[1]     External: :3000
[1]  ----------------------------------
[1]           UI: http://localhost:3001
[1]  UI External: :3001
[1]  ----------------------------------
[1] [BS] Serving files from: ./
[1] [BS] Watching files...
[1] 15.12.19 08:14:48 304 GET /./index.html (Unknown - 59ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/es6-shim/es6-shim.js (Unknown - 729ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/angular2/bundles/angular2-polyfills.js (Unknown - 205ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/systemjs/dist/system.src.js (Unknown - 204ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/rxjs/bundles/Rx.js (Unknown - 204ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/angular2/bundles/angular2.dev.js (Unknown - 204ms)
[0] 8:14:50 AM - Compilation complete. Watching for file changes.
[1] [BS] File changed: app/appponent.js
[1] [BS] File changed: app/boot.js
[1] 15.12.19 08:14:51 200 GET /app/boot.js (Unknown - 92ms)
[1] 15.12.19 08:14:52 200 GET /app/appponent.js (Unknown - 29ms)
[1] events.js:141
[1]       throw er; // Unhandled 'error' event
[1]       ^
[1] 
[1] Error: watch node_modules/angular2/es6/dev/src/common/directives/ng_if.js ENOSPC
[1]     at exports._errnoException (util.js:855:11)
[1]     at FSWatcher.start (fs.js:1313:19)
[1]     at Object.fs.watch (fs.js:1341:11)
[1]     at createFsWatchInstance (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:37:15)
[1]     at setFsWatchListener (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[1]     at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:228:14)
[1]     at FSWatcher.NodeFsHandler._handleFile (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:255:21)
[1]     at FSWatcher.<anonymous> (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:473:21)
[1]     at FSReqWrap.oncomplete (fs.js:82:15)
[1] 
[1] npm ERR! Linux 3.19.0-41-generic
[1] npm 
[1] ERR! argv "/opt/node-v5.3.0-linux-x64/bin/node" "/opt/node-v5.3.0-linux-x64/bin/npm" "run" "lite"
[1] npm ERR! node v5.3.0
[1] npm ERR! npm  v3.3.12
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! [email protected] lite: `lite-server`
[1] npm ERR! Exit status 1
[1] npm ERR! 
[1] npm ERR! Failed at the [email protected] lite script 'lite-server'.
[1] npm ERR! Make sure you have the latest version of node.js and npm installed.
[1] npm ERR! If you do, this is most likely a problem with the angular2-quickstart package,
[1] npm ERR! not with npm itself.
[1] npm ERR!
[1]  Tell the author that this fails on your system:
[1] npm ERR!     lite-server
[1] npm ERR! You can get their info via:
[1] npm ERR!     npm owner ls angular2-quickstart
[1] npm ERR! There is likely additional logging output above.
[1] 
[1] npm ERR! Please include the following file with any support request:
[1] npm ERR!     /home/ubuntu/jsProjects/angular2-quickstart/npm-debug.log
[1] npm run lite exited with code 1

I'm trying out the official 5 Min Quickstart about angular 2 for Typescript. I followed all steps and when I run npm start it did pop up the expected My First Angular 2 App message on my firefox browser.

However, when I checked the console, I found error messages:

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

I don't know if it's related to the warning message I received earlier when I run npm install on the root folder of the project:

npm WARN install Couldn't install optional dependency: Unsupported
npm WARN EPACKAGEJSON [email protected] No description
npm WARN EPACKAGEJSON [email protected] No repository field.

Can someone tell me what's wrong my approach? A more detailed console output looks like this:

> [email protected] start /home/ubuntu/jsProjects/angular2-quickstart
> concurrent "npm run tsc:w" "npm run lite" 

[0] 
[0] > [email protected] tsc:w /home/ubuntu/jsProjects/angular2-quickstart
[0] > tsc -w
[0] 
[1] 
[1] > [email protected] lite /home/ubuntu/jsProjects/angular2-quickstart
[1] > lite-server
[1] 
[1] [BS] Access URLs:
[1]  ----------------------------------
[1]        Local: http://localhost:3000
[1]     External: http://10.0.0.17:3000
[1]  ----------------------------------
[1]           UI: http://localhost:3001
[1]  UI External: http://10.0.0.17:3001
[1]  ----------------------------------
[1] [BS] Serving files from: ./
[1] [BS] Watching files...
[1] 15.12.19 08:14:48 304 GET /./index.html (Unknown - 59ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/es6-shim/es6-shim.js (Unknown - 729ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/angular2/bundles/angular2-polyfills.js (Unknown - 205ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/systemjs/dist/system.src.js (Unknown - 204ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/rxjs/bundles/Rx.js (Unknown - 204ms)
[1] 15.12.19 08:14:49 304 GET /node_modules/angular2/bundles/angular2.dev.js (Unknown - 204ms)
[0] 8:14:50 AM - Compilation complete. Watching for file changes.
[1] [BS] File changed: app/app.component.js
[1] [BS] File changed: app/boot.js
[1] 15.12.19 08:14:51 200 GET /app/boot.js (Unknown - 92ms)
[1] 15.12.19 08:14:52 200 GET /app/app.component.js (Unknown - 29ms)
[1] events.js:141
[1]       throw er; // Unhandled 'error' event
[1]       ^
[1] 
[1] Error: watch node_modules/angular2/es6/dev/src/common/directives/ng_if.js ENOSPC
[1]     at exports._errnoException (util.js:855:11)
[1]     at FSWatcher.start (fs.js:1313:19)
[1]     at Object.fs.watch (fs.js:1341:11)
[1]     at createFsWatchInstance (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:37:15)
[1]     at setFsWatchListener (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[1]     at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:228:14)
[1]     at FSWatcher.NodeFsHandler._handleFile (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:255:21)
[1]     at FSWatcher.<anonymous> (/home/ubuntu/jsProjects/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:473:21)
[1]     at FSReqWrap.oncomplete (fs.js:82:15)
[1] 
[1] npm ERR! Linux 3.19.0-41-generic
[1] npm 
[1] ERR! argv "/opt/node-v5.3.0-linux-x64/bin/node" "/opt/node-v5.3.0-linux-x64/bin/npm" "run" "lite"
[1] npm ERR! node v5.3.0
[1] npm ERR! npm  v3.3.12
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! [email protected] lite: `lite-server`
[1] npm ERR! Exit status 1
[1] npm ERR! 
[1] npm ERR! Failed at the [email protected] lite script 'lite-server'.
[1] npm ERR! Make sure you have the latest version of node.js and npm installed.
[1] npm ERR! If you do, this is most likely a problem with the angular2-quickstart package,
[1] npm ERR! not with npm itself.
[1] npm ERR!
[1]  Tell the author that this fails on your system:
[1] npm ERR!     lite-server
[1] npm ERR! You can get their info via:
[1] npm ERR!     npm owner ls angular2-quickstart
[1] npm ERR! There is likely additional logging output above.
[1] 
[1] npm ERR! Please include the following file with any support request:
[1] npm ERR!     /home/ubuntu/jsProjects/angular2-quickstart/npm-debug.log
[1] npm run lite exited with code 1
Share Improve this question edited Feb 24, 2017 at 15:25 DilumN 2,8976 gold badges32 silver badges44 bronze badges asked Dec 19, 2015 at 16:25 BamqfBamqf 3,54210 gold badges34 silver badges47 bronze badges 4
  • Is your disk full? Does the user have correct permissions to write where he needs to write? – m90 Commented Dec 19, 2015 at 16:29
  • 2 @m90 No it's not full, and I do have the permission to write in the project folder. – Bamqf Commented Dec 19, 2015 at 16:35
  • 1 Maybe this helps you: stackoverflow.com/questions/22475849/node-js-error-enospc – m90 Commented Dec 19, 2015 at 16:36
  • Furthermore this is related to: stackoverflow.com/a/31926452 – Arne L. Commented Jan 9, 2017 at 14:35
Add a comment  | 

3 Answers 3

Reset to default 23

I resolved this by increasing the amount of inotify watchers :

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

Its a problem of space. When your installing packages, your disc can nolonger accomodate them thus the error. Solution to to shift the project to a location with more space or add space to the current location.

This is what I did in my case to resolve this error.

This error can also occur during other processes (for example, the more modern ng serve).

Although it should be avoided if you do not trust the code, running the command with sudo will quickly fix this error.

发布评论

评论列表(0)

  1. 暂无评论