-1

I am working on a Laravel 5.2 and Angular 2 project and I've just finished setting up angular but when running npm start, I get the following error :

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! @ postinstall: `typings install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ postinstall script 'typings install'.
npm ERR! This is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

Can you guys help me ?

This is the content of my package.json :

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch",
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "lite": "lite-server",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings"
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    "laravel-elixir": "^5.0.0",
    "bootstrap-sass": "^3.0.0",
    "concurrently": "^1.0.0",
    "del": "^2.2.0"
  },
  "dependencies": {
    "angular2": "2.0.0-beta.0",
    "bootstrap-sass": "^3.0.0",
    "elixir-typescript": "^1.1.2",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "laravel-elixir": "^4.0.0",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.0",
    "systemjs": "0.19.6",
    "zone.js": "0.5.10"
  }
}
halfer
  • 19,824
  • 17
  • 99
  • 186
Ines Tlili
  • 790
  • 6
  • 21

2 Answers2

1

Your script is failing while trying to run 'typings install'.
1. Include typings in devDependencies

{
  "devDependencies": {
    "concurrently": "^2.0.0",
    "lite-server": "^2.2.0",
    "typescript": "^1.8.10",
    "typings": "^1.0.4"
  }
}
  1. Run npm install

  2. Create typings.json as below

    {
      "globalDependencies": {
        "core-js": "registry:dt/core-js#0.0.0+20160602141332",
        "jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
        "node": "registry:dt/node#6.0.0+20160807145350"
      }
    }
    
  3. npm start

    if you still having issue install typings globally npm install typings --global

  • That's what I did and it worked just fine ! Now I am having another issue :/ when the application is served , I get a message in my browser saying 'cannot GET /' ! I am new to angular , so I couldn't figure it out – Ines Tlili Aug 19 '16 at 11:05
  • Need more details to understand the actual problem. Can you create plunker – Srikanth Injarapu Aug 19 '16 at 13:32
  • It's a whole laravel application. I am afraid it would be difficult to create a plunker. Just tell me what details do you need and I'll have you know ! – Ines Tlili Aug 19 '16 at 14:08
  • Then it should be issue with Laravel routing not Angular. – Srikanth Injarapu Aug 19 '16 at 15:42
  • I turned back to angular 1 ! Im much more familiar with it ! I have no problems now ! Thank you friend :D – Ines Tlili Aug 22 '16 at 00:20
0

I too face this problem i do the following steps

 1. i uninstall nodejs and install the latest version.
 2. close the command promt and open.
 3. execute npm install
 4. execute npm build(not nesessery) 
 5. execute npm start

This works for me.

Aswin KV
  • 1,710
  • 2
  • 12
  • 23
  • For my case , it was just some missing dependencies in my package.json ! My problem is solved, than u a lot – Ines Tlili Aug 18 '16 at 18:55