Angular 2

时间:2016-12-09 07:35:35

标签: angularjs npm

我在使用npm start时收到此错误消息。我从git clone https://github.com/angular/quickstart.git quickstart克隆了这个 在anular.io上给出。

angular-quickstart@1.0.0 start /opt/lampp/htdocs/quickstart
> tsc && concurrently "tsc -w" "lite-server" 

[0] fs.js:1307
[0]     throw error;
[0]     ^
[0] 
[0] Error: watch /opt/lampp/htdocs/quickstart ENOSPC
[0]     at exports._errnoException (util.js:1022:11)
[0]     at FSWatcher.start (fs.js:1305:19)
[0]     at Object.fs.watch (fs.js:1330:11)
[0]     at Object.watchDirectory (/opt/lampp/htdocs/quickstart/node_modules/typescript/lib/tsc.js:1727:32)
[0]     at Object.executeCommandLine (/opt/lampp/htdocs/quickstart/node_modules/typescript/lib/tsc.js:39774:43)
[0]     at Object.<anonymous> (/opt/lampp/htdocs/quickstart/node_modules/typescript/lib/tsc.js:40095:4)
[0]     at Module._compile (module.js:571:32)
[0]     at Object.Module._extensions..js (module.js:580:10)
[0]     at Module.load (module.js:488:32)
[0]     at tryModuleLoad (module.js:447:12)
[0] tsc -w exited with code 1
[1] Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
[1] ** browser-sync config **
[1] { injectChanges: false,
[1]   files: [ './**/*.{html,htm,css,js}' ],
[1]   watchOptions: { ignored: 'node_modules' },
[1]   server: { baseDir: './', middleware: [ [Function], [Function] ] } }
[1] events.js:160
[1]       throw er; // Unhandled 'error' event
[1]       ^
[1] 
[1] Error: watch . ENOSPC
[1]     at exports._errnoException (util.js:1022:11)
[1]     at FSWatcher.start (fs.js:1305:19)
[1]     at Object.fs.watch (fs.js:1330:11)
[1]     at createFsWatchInstance (/opt/lampp/htdocs/quickstart/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:37:15)
[1]     at setFsWatchListener (/opt/lampp/htdocs/quickstart/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[1]     at FSWatcher.NodeFsHandler._watchWithNodeFs (/opt/lampp/htdocs/quickstart/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:228:14)
[1]     at FSWatcher.NodeFsHandler._handleDir (/opt/lampp/htdocs/quickstart/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:407:19)
[1]     at FSWatcher.<anonymous> (/opt/lampp/htdocs/quickstart/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:455:19)
[1]     at FSWatcher.<anonymous> (/opt/lampp/htdocs/quickstart/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:460:16)
[1]     at FSReqWrap.oncomplete (fs.js:111:15)
[1] lite-server exited with code 1

npm ERR! Linux 4.4.0-53-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.2.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 start: `tsc && concurrently "tsc -w" "lite-server" `
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular-quickstart@1.0.0 start script 'tsc && concurrently "tsc -w" "lite-server" '.
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 angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc && concurrently "tsc -w" "lite-server" 
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/lampp/htdocs/quickstart/npm-debug.log

的package.json

{
    "name": "angular-quickstart",
    "version": "1.0.0",
    "description": "QuickStart package.json from the documentation, supplemented with testing support",
   "scripts": {
     "start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
     "e2e": "tsc && concurrently \"http-server -s\" \"protractor  protractor.config.js\" --kill-others --success first",
     "lint": "tslint ./app/**/*.ts -t verbose",
     "lite": "lite-server",
     "pree2e": "webdriver-manager update",
     "test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
     "test-once": "tsc && karma start karma.conf.js --single-run",
     "tsc": "tsc",
     "tsc:w": "tsc -w"
  },
    "keywords": [],
    "author": "",
    "license": "MIT",
    "dependencies": {
      "@angular/common": "~2.3.0",
      "@angular/compiler": "~2.3.0",
      "@angular/core": "~2.3.0",
      "@angular/forms": "~2.3.0",
      "@angular/http": "~2.3.0",
      "@angular/platform-browser": "~2.3.0",
      "@angular/platform-browser-dynamic": "~2.3.0",
      "@angular/router": "~3.3.0",

      "angular-in-memory-web-api": "~0.1.17",
      "systemjs": "0.19.40",
      "core-js": "^2.4.1",
      "reflect-metadata": "^0.1.8",
      "rxjs": "5.0.0-rc.4",
      "zone.js": "^0.7.2"
  },
    "devDependencies": {
    "concurrently": "^3.1.0",
    "lite-server": "^2.2.2",
    "typescript": "~2.0.10",

    "canonical-path": "0.0.2",
    "http-server": "^0.9.0",
    "tslint": "^3.15.1",
    "lodash": "^4.16.4",
    "jasmine-core": "~2.4.1",
    "karma": "^1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "4.0.9",
    "webdriver-manager": "10.2.5",
    "rimraf": "^2.5.4",

    "@types/node": "^6.0.46",
    "@types/jasmine": "^2.5.36",
    "@types/selenium-webdriver": "^2.53.33"
  },
    "repository": {}
}

节点js版本是v4.2.6 NPM版本是3.10.10 因为我是棱角分明的新人,对这个问题一无所知请帮助。

1 个答案:

答案 0 :(得分:2)

这是一个'空间不足'错误 - Node没有使用文件系统的权限。试试sudo:

sudo npm start