【问题标题】:Error while "npm start" in Angular 2Angular 2 中的“npm start”时出错
【发布时间】:2017-01-08 06:37:22
【问题描述】:

我在使用 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": {}
}

Node js版本为v4.2.6 NPM 版本是 3.10.10 由于我是 Angular 新手,对此问题一无所知,请帮助。

【问题讨论】:

  • 感谢 Ramkishan 发布错误消息。该错误消息中有几个提示。您可能有错误的节点版本,请参阅:npm ERR! Make sure you have the latest version of node.js and npm installed.npm ERR! node v7.2.1 尝试安装 newest node version 并查看错误是否仍然存在。您可能还想将您的错误作为问题发布到 git 存储库本身。但请先检查所有版本。
  • 谢谢chitzui的回答。好的,让我更新节点 js
  • 对不起@chitzui 但不幸的是问题还没有解决。我已将节点版本更新为 7.2.1。

标签: angularjs npm


【解决方案1】:

这是一个“空间不足”错误 - 节点无权使用文件系统。试试 sudo:

sudo npm start

【讨论】:

    猜你喜欢
    • 2018-11-12
    • 2017-02-07
    • 2017-07-24
    • 2018-02-10
    • 2018-07-16
    • 2016-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多