0

I'm setting up Angular 2 Quick Start Tutorial from scratch on a virtualbox Linux machine build. I've followed all the instructions as part of the 5 minute quick start but when I get to the "npm start" I get this error:

/media/sf_testdev/angular-quickstart$ npm start

> angular-quickstart@1.0.0 start /media/sf_testdev/angular-quickstart
> tsc && concurrently "npm run tsc:w" "npm run lite" 

sh: 1: concurrently: not found

npm ERR! Linux 4.4.0-42-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! angular-quickstart@1.0.0 start: `tsc && concurrently "npm run tsc:w" "npm run lite" `
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the angular-quickstart@1.0.0 start script 'tsc && concurrently "npm run tsc:w" "npm run lite" '.
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 "npm run tsc:w" "npm run lite" 
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!     /media/sf_testdev/angular-quickstart/npm-debug.log

Here is my current package.json file

{
  "name": "angular-quickstart",
  "version": "1.0.0",
  "scripts": {
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "lite": "lite-server",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0-rc.6",
    "@angular/compiler": "2.0.0-rc.6",
    "@angular/compiler-cli": "0.6.0",
    "@angular/core": "2.0.0-rc.6",
    "@angular/forms": "2.0.0-rc.6",
    "@angular/http": "2.0.0-rc.6",
    "@angular/platform-browser": "2.0.0-rc.6",
    "@angular/platform-browser-dynamic": "2.0.0-rc.6",
    "@angular/router": "3.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.6",
    "core-js": "^2.4.1",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.11",
    "systemjs": "0.19.27",
    "zone.js": "^0.6.17",
    "angular2-in-memory-web-api": "0.0.18",
    "bootstrap": "^3.3.6"
  },
  "devDependencies": {
    "concurrently": "^2.2.0",
    "lite-server": "^2.2.2",
    "typescript": "^1.8.10",
    "typings":"^1.3.2"
  }
}

Nothing I have tried online seems to work to fix. thanks for the help in advance!

Matthew Green
  • 10,161
  • 4
  • 36
  • 54
Robert
  • 343
  • 6
  • 16

3 Answers3

1

It seems the error is when it tries to run the command concurrently

sh: 1: concurrently: not found

you have to run npm install first to install the dependencies and then you will have concurrently, and everything should work fine.

Eddie Martinez
  • 13,582
  • 13
  • 81
  • 106
  • concurrently is installed and I have ran npm install – Robert Oct 13 '16 at 21:54
  • I have thought that the command "npm start" will automatically call "npm install" when there are some missed dependencies. It seems that we have to run each command seperately, Anyway, it is a great reminder to run "npm install" first. Thanks! – MChaker Oct 16 '16 at 14:30
  • start is just a script you set up in the package.json. You could put anything there, i.e. npm start could run 'npm uninstall'. in his case, you look under scripts in the package.json and it is starting the lite server and the typescript compiler. – Eddie Martinez Oct 17 '16 at 13:41
0
  • That's because tsc command finds errors in the code. If you execute only tsc in terminal can you see the errors and fix it.

  • If you only run the app remove tsc && in start line, finally this is as:

    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\",

    to

    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",

With it works.

Deoxyseia
  • 1,359
  • 18
  • 29
0

Sorry I did dont see all the log, concurrently: not found is because concurrently module isn't install, deleting node_modules folder and executing:

npm install

Or installing specifically concurrently with:

npm install -g concurrently
Deoxyseia
  • 1,359
  • 18
  • 29