Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find type definition file for 'source-map'

I am trying to run an angular 5 app which I upgraded from angular 4 but am encountering this error when I run npm run server:dev:

[at-loader] Checking finished with 1 errors
[at-loader] TS2688: Cannot find type definition file for 'source-map'.

Here is my package.json

    {
  "name": "Hidden",
  "version": "v1.0.0",
  "description": "",
  "keywords": [
    "Hidden"
  ],
  "author": "Hidden",
  "license": "MIT",
  "scripts": {
    "build:dev": "webpack --config config/webpack.dev.js --progress --profile",
    "build:docker": "npm run build:prod && docker build -t angular2-webpack-start:latest .",
    "build:prod": "webpack --config config/webpack.prod.js  --progress --profile --bail",
    "build": "npm run build:dev",
    "ci": "npm run lint && npm test && npm run e2e",
    "clean:dist": "npm run rimraf -- dist",
    "clean:install": "npm set progress=false && npm install",
    "clean:start": "npm start",
    "clean": "npm cache clean && npm run rimraf -- node_modules doc coverage dist",
    "docker": "docker",
    "docs": "npm run typedoc -- --options typedoc.json --exclude '**/*.spec.ts' ./src/",
    "e2e:live": "npm run e2e -- --elementExplorer",
    "e2e": "npm run protractor",
    "github-deploy:dev": "webpack --config config/webpack.github-deploy.js --progress --profile --github-dev",
    "github-deploy:prod": "webpack --config config/webpack.github-deploy.js --progress --profile --github-prod",
    "github-deploy": "npm run github-deploy:dev",
    "lint": "npm run tslint \"src/**/*.ts\"",
    "lite": "lite-server",
    "postversion": "git push && git push --tags",
    "prebuild:dev": "npm run clean:dist",
    "prebuild:prod": "npm run clean:dist",
    "preclean:install": "npm run clean",
    "preclean:start": "npm run clean",
    "pree2e": "npm run webdriver:update -- --standalone",
    "preversion": "npm test",
    "protractor": "protractor",
    "rimraf": "rimraf",
    "server:dev:hmr": "npm run server:dev -- --inline --hot",
    "server:dev": "webpack-dev-server --config config/webpack.dev.js --progress --profile --watch --content-base src/",
    "server:prod": "http-server dist --cors",
    "server": "npm run server:dev",
    "start:hmr": "npm run server:dev:hmr",
    "start": "npm run server:dev",
    "test": "karma start",
    "tslint": "tslint",
    "typedoc": "typedoc",
    "version": "npm run build",
    "watch:dev:hmr": "npm run watch:dev -- --hot",
    "watch:dev": "npm run build:dev -- --watch",
    "watch:prod": "npm run build:prod -- --watch",
    "watch:test": "npm run test -- --auto-watch --no-single-run",
    "watch": "npm run watch:dev",
    "webdriver-manager": "webdriver-manager",
    "webdriver:start": "npm run webdriver-manager start",
    "webdriver:update": "npm run webdriver-manager update",
    "webpack-dev-server": "webpack-dev-server",
    "webpack": "webpack"
  },
  "dependencies": {
    "@angular/animations": "^5.2.3",
    "@angular/common": "^5.2.3",
    "@angular/compiler": "^5.2.3",
    "@angular/core": "^5.2.3",
    "@angular/forms": "^5.2.3",
    "@angular/http": "^5.2.3",
    "@angular/material": "^2.0.0-beta.12",
    "@angular/platform-browser": "^5.2.3",
    "@angular/platform-browser-dynamic": "^5.2.3",
    "@angular/platform-server": "^5.2.3",
    "@angular/router": "^5.2.3",
    "@angularclass/conventions-loader": "^1.0.2",
    "@angularclass/hmr": "~2.1.3",
    "@angularclass/hmr-loader": "~3.0.4",
    "@ngtools/webpack": "^1.9.7",
    "@types/jquery": "^3.2.18",
    "angular-tag-cloud-module": "^2.4.0",
    "assets-webpack-plugin": "^3.4.0",
    "b64-to-blob": "^1.2.19",
    "core-js": "^2.4.1",
    "http-server": "^0.9.0",
    "ie-shim": "^0.1.0",
    "jquery": "^3.2.1",
    "ng2-bs3-modal": "^0.13.0",
    "ng2-img-cropper": "^0.9.0",
    "ngc-webpack": "^4.1.2",
    "occurences": "^2.2.2",
    "reflect-metadata": "^0.1.10",
    "rxjs": "^5.5.6",
    "zone.js": "~0.8.14"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^5.2.3",
    "@types/hammerjs": "^2.0.34",
    "@types/jasmine": "2.5.45",
    "@types/node": "^7.0.39",
    "@types/selenium-webdriver": "2.53.38",
    "@types/source-map": "^0.5.0",
    "@types/uglify-js": "^2.6.28",
    "@types/webpack": "^2.2.16",
    "angular2-template-loader": "^0.6.2",
    "assets-webpack-plugin": "^3.5.1",
    "awesome-typescript-loader": "~3.1.2",
    "codelyzer": "~2.1.1",
    "copy-webpack-plugin": "^4.0.1",
    "css-loader": "^0.28.0",
    "exports-loader": "^0.6.4",
    "expose-loader": "^0.7.3",
    "extract-text-webpack-plugin": "~3.0.0",
    "file-loader": "^0.11.1",
    "gh-pages": "^1.0.0",
    "html-webpack-plugin": "^2.28.0",
    "imports-loader": "^0.7.1",
    "istanbul-instrumenter-loader": "2.0.0",
    "jasmine-core": "^2.5.2",
    "json-loader": "^0.5.4",
    "karma": "^1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-coverage": "^1.1.1",
    "karma-jasmine": "^1.0.2",
    "karma-mocha-reporter": "^2.0.0",
    "karma-remap-coverage": "^0.1.4",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-webpack": "1.8.1",
    "ng-router-loader": "^2.1.0",
    "node-sass": "^4.5.2",
    "npm-run-all": "^4.0.2",
    "parse5": "^3.0.2",
    "protractor": "^4.0.10",
    "raw-loader": "0.5.1",
    "rimraf": "~2.6.1",
    "sass-loader": "^6.0.3",
    "script-ext-html-webpack-plugin": "^1.8.5",
    "source-map-loader": "^0.2.1",
    "string-replace-loader": "~1.3.0",
    "strip-loader": "^0.1.2",
    "style-loader": "^0.18.1",
    "to-string-loader": "^1.1.5",
    "ts-helpers": "1.1.2",
    "ts-node": "^3.3.0",
    "tslint": "~4.5.1",
    "typedoc": "^0.7.1",
    "typescript": "2.4.2",
    "url-loader": "^0.5.8",
    "v8-lazy-parse-webpack-plugin": "^0.3.0",
    "webpack": "3.5.5",
    "webpack-dev-middleware": "^1.10.1",
    "webpack-dev-server": "~2.7.1",
    "webpack-md5-hash": "^0.0.5",
    "webpack-merge": "~4.1.0"
  },
  "engines": {
    "node": ">= 4.2.1",
    "npm": ">= 3"
  }
}
like image 725
Sam Ngugi Avatar asked Jan 28 '23 15:01

Sam Ngugi


1 Answers

Finally, I fixed the issue.

I followed these steps:

  1. npm install source-map@latest --save
  2. In package.json I added @types/source-map": "0.5.0. Note that I specifically specified version 0.5.0
  3. npm install
like image 148
Sam Ngugi Avatar answered Jan 31 '23 09:01

Sam Ngugi