Gitlab ci doesn't install all dependencies (angular app) - node.js

I'm trying to build and deploy angular application using gitlab-ci
here is my config
stages:
- build
build:
stage: build
image: node:12.21.0
only:
- master
script:
- npm install -g #angular/cli#11.2.6
- npm install
- npm run build:i18n
and here are my dependencies from package.json
"dependencies": {
"#agm/core": "^1.1.0",
"#angular/animations": "~11.2.5",
"#angular/common": "~11.2.5",
"#angular/compiler": "~11.2.5",
"#angular/core": "~11.2.5",
"#angular/fire": "^6.1.4",
"#angular/forms": "~11.2.5",
"#angular/localize": "^11.2.5",
"#angular/platform-browser": "^11.2.5",
"#angular/platform-browser-dynamic": "~11.2.5",
"#angular/router": "~11.2.5",
"#asymmetrik/ngx-leaflet": "^8.1.0",
"#ng-bootstrap/ng-bootstrap": "^6.2.0",
"#popperjs/core": "^2.9.1",
"#swimlane/ngx-datatable": "^17.1.0",
"#types/jquery": "^3.5.5",
"angular-calendar": "^0.28.22",
"angular2-text-mask": "^9.0.0",
"angularx-flatpickr": "^6.5.2",
"apexcharts": "^3.25.0",
"bootstrap": "^4.6.0",
"bourbon": "^4.3.4",
"chart.js": "^2.9.4",
"date-fns": "^1.30.1",
"easy-pie-chart": "^2.1.7",
"file-saver": "^2.0.5",
"firebase": "^7.0 || ^8.0",
"flatpickr": "^4.6.9",
"jquery": "^3.6.0",
"jquery-sparkline": "^2.4.0",
"leaflet": "^1.7.1",
"lodash": "^4.17.21",
"ng-apexcharts": "^1.5.8",
"ng2-charts": "^2.4.2",
"ngx-chips": "^2.2.2",
"ngx-perfect-scrollbar": "^9.0.0",
"ngx-toastr": "^12.1.0",
"ngx-ui-switch": "^8.3.0",
"peity": "^3.3.0",
"popper.js": "^1.16.1",
"quill": "^1.3.7",
"rxjs": "^6.6.6",
"sweetalert2": "^7.33.1",
"text-mask-addons": "^3.8.0",
"tslib": "^2.1.0",
"zone.js": "~0.10.3"
},
npm run build:i18n is set to run ng build --prod --localize command.
Problem:npm run build:i18n fails every time with this error:
Error: src/app/merchandises/merchandises.service.ts:6:24 - error TS2307: Cannot find module 'file-saver/src/fileSaver' or its corresponding type declarations.
6 import { saveAs } from 'file-saver/src/fileSaver';
~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: ./src/app/merchandises/merchandises.service.ts
But on my pc where I use same version of node, npm and nagular/cli it works just fine and file-saver package is clearly in dependencies. I'm not caching anything at this point (I did but I have removed it while testing).
Any ideas?

Try using a different image with Angular CLI :
build_front_end:
image: trion/ng-cli
https://hub.docker.com/r/trion/ng-cli/

Related

Error: Data path "" must NOT have additional properties(allowedCommonJsDependencies) when upgrading from Angular 11 to 12

So I just updated the Angular version of my project from 11 to 12 and whenever I try to run the server, I get the following error:
Warning: Running a server with --disable-host-check is a security risk. See https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a for more information.
"BuildCustomWebpackBrowserSchema" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
Schema validation failed with the following errors:
Data path "" must NOT have additional properties(allowedCommonJsDependencies).
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! smart-med#0.0.0 start: `node --max_old_space_size=8048 ./node_modules/#angular/cli/bin/ng serve --disable-host-check "pharmacy"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the smart-med#0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I have already tried deleting node_modules and package_lock-json and run npm i but it didn't work. Furthermore the file "allowedCommonJsDependencies" does not exist on angular.json
Package.json:
"dependencies": {
"#angular/animations": "~12.2.17",
"#angular/cdk": "~12.2.13",
"#angular/cli": "^12.2.18",
"#angular/common": "~12.2.17",
"#angular/compiler": "~12.2.17",
"#angular/core": "~12.2.17",
"#angular/forms": "~12.2.17",
"#angular/localize": "^12.2.17",
"#angular/material": "~12.2.13",
"#angular/material-moment-adapter": "~12.2.13",
"#angular/platform-browser": "~12.2.17",
"#angular/platform-browser-dynamic": "~12.2.17",
"#angular/router": "~12.2.17",
"#angular/service-worker": "~12.2.17",
"#auth0/angular-jwt": "^3.0.1",
"#auth0/auth0-spa-js": "^1.6.0",
"#devexpress/analytics-core": "^21.1.5",
"#ngx-translate/core": "^11.0.1",
"#ngx-translate/http-loader": "^4.0.0",
"#ngxs/logger-plugin": "^3.4.3",
"#ngxs/router-plugin": "^3.4.3",
"#ngxs/store": "^3.4.3",
"#zxing/ngx-scanner": "^3.0.0",
"adal-angular4": "4.0.12",
"angular-tree-component": "~8.5.6",
"angularx-qrcode": "^2.3.7",
"bootstrap": "^3.4.1",
"core-js": "~3.6.4",
"devexpress-reporting-angular": "^21.1.5",
"devextreme": "^21.1.5",
"immer": "^2.0.0",
"keycloak-angular": "^7.3.1",
"keycloak-js": "^10.0.2",
"lodash-es": "^4.17.11",
"lodash.memoize": "^4.1.2",
"moment-timezone": "^0.5.23",
"ngx-infinite-scroll": "^9.0.0",
"ngx-mask": "^9.1.0",
"ngx-responsive": "^9.0.0",
"roboto-fontface": "^0.8.0",
"rxjs": "~6.5.4",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-builders/custom-webpack": "~9.0.0",
"#angular-builders/jest": "~9.0.0",
"#angular-devkit/build-angular": "~12.2.18",
"#angular-devkit/build-ng-packagr": "~0.1002.4",
"#angular-devkit/schematics": "~12.2.18",
"#angular/compiler-cli": "~12.2.17",
"#angular/language-service": "~12.2.17",
"#babel/compat-data": "~7.9.0",
"#openapitools/openapi-generator-cli": "^2.2.3",
"#testing-library/angular": "^10.0.2",
"#testing-library/dom": "^7.24.3",
"#testing-library/jest-dom": "^5.11.4",
"#testing-library/user-event": "^12.1.6",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/jest": "~25.1.5",
"#types/lodash-es": "^4.17.3",
"#types/moment-timezone": "^0.5.12",
"#types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"http-server": "~0.12.1",
"husky": "^8.0.1",
"istanbul-combine": "^0.3.0",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"jest": "~25.2.7",
"jest-junit": "^10.0.0",
"lint-staged": "^10.2.11",
"ng-packagr": "^12.2.7",
"npm-run-all": "^4.1.5",
"prettier-stylelint": "^0.4.2",
"protractor": "~7.0.0",
"rimraf": "^2.6.3",
"scss-bundle": "^2.5.1",
"stylelint": "^9.10.1",
"stylelint-config-prettier": "^6.0.0",
"stylelint-config-standard": "^18.2.0",
"ts-loader": "^5.4.4",
"ts-node": "~7.0.0",
"tslint": "~6.1.0",
"tslint-plugin-prettier": "^2.0.1",
"typescript": "~4.3.5",
"webpack-bundle-analyzer": "^3.6.0",
"yamljs": "^0.3.0",
"yargs": "^17.1.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
How can I fix this?

npm start stop with exit status 3 : Failed to exec start script [Angular]

I'm new on Angular and I have to work on a project in this technology.I set up the project but when I run the npm start command, the process npm start stop suddenly : the ng serve fails. I tried to investigate but I found nothing that can fix my problem.
You can see the errors here : errors
npm version : 6.14.11
node version : v14.15.5
Dependencies in the package.json file :
"dependencies": {
"#angular/animations": "^11.0.3",
"#angular/cdk": "^11.0.1",
"#angular/common": "~11.0.3",
"#angular/compiler": "~11.0.3",
"#angular/core": "~11.0.3",
"#angular/flex-layout": "^11.0.0-beta.33",
"#angular/forms": "~11.0.3",
"#angular/material": "^11.0.1",
"#angular/platform-browser": "~11.0.3",
"#angular/platform-browser-dynamic": "~11.0.3",
"#angular/platform-server": "~11.0.3",
"#angular/router": "~11.0.3",
"#angular/service-worker": "^11.0.3",
"#ngx-prism/core": "^2.0.1",
"#syncfusion/ej2-angular-richtexteditor": "^18.3.52",
"#types/prismjs": "^1.16.2",
"#types/socket.io-client": "^1.4.34",
"angular-http-server": "^1.9.0",
"app-root-path": "^3.0.0",
"chart.js": "^2.9.4",
"compodoc": "0.0.41",
"core-js": "^3.8.0",
"dotenv": "^8.2.0",
"http-server": "^0.12.3",
"http-status": "^1.5.0",
"jquery": "^3.5.1",
"ngx-captcha": "^8.0.1",
"ngx-countdown": "^11.0.0",
"ngx-countdown-timer": "^0.2.0",
"ngx-drag-drop": "^2.0.0",
"ngx-json-viewer": "^2.4.0",
"ngx-mat-select-search": "^3.1.4",
"ngx-pipes": "^2.7.5",
"ngx-socket-io": "^3.2.0",
"prismjs": "^1.22.0",
"rxjs": "^6.6.3",
"rxjs-compat": "^6.6.3",
"socket.io-client": "^3.0.3",
"xls": "^0.5.1",
"xlsx": "^0.16.9",
"zone.js": "^0.11.3"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.1100.3",
"#angular/compiler-cli": "^11.0.3",
"#compodoc/compodoc": "^1.1.11",
"#types/chart.js": "^2.9.28",
"#types/jasmine": "3.6.2",
"#types/node": "^14.14.10",
"#types/source-map": "^0.5.7",
"#types/webpack": "^4.41.25",
"typescript": "~4.0.0"
}
Do you have an idea ?
I tried to run :
npm cache clean --force
npm install
npm start
But that don't help me.

Error: Metadata version mismatch for module #ionic-native/core/decorators.d.ts

I can build my ionic project with ionic cordova build ios but when I build with --release --prod options I got this error :
Error: Metadata version mismatch for module
node_modules/#ionic-native/core/decorators.d.ts, found version 4, expected 3
I know it's a #ionic-native plugins version issue but I cannot fix it. I found a lot of git issues or forum but no one have the same versions as me.
Here are my dependencies :
"dependencies": {
"#angular/common": "^4.4.7",
"#angular/compiler": "^4.4.7",
"#angular/compiler-cli": "^4.4.7",
"#angular/core": "^4.4.7",
"#angular/forms": "^4.4.7",
"#angular/http": "^4.4.7",
"#angular/platform-browser": "^4.4.7",
"#angular/platform-browser-dynamic": "^4.4.7",
"#firebase/app": "^0.1.10",
"#ionic-native/background-mode": "^4.17.0",
"#ionic-native/camera": "^4.17.0",
"#ionic-native/core": "^4.17.0",
"#ionic-native/facebook": "^4.17.0",
"#ionic-native/file": "^4.17.0",
"#ionic-native/file-transfer": "^4.17.0",
"#ionic-native/firebase-analytics": "^4.17.0",
"#ionic-native/google-maps": "^4.15.1",
"#ionic-native/google-plus": "^4.17.0",
"#ionic-native/in-app-browser": "^4.17.0",
"#ionic-native/in-app-purchase": "^4.17.0",
"#ionic-native/local-notifications": "^4.17.0",
"#ionic-native/media": "^4.17.0",
"#ionic-native/native-audio": "^4.17.0",
"#ionic-native/social-sharing": "^4.17.0",
"#ionic-native/splash-screen": "^4.17.0",
"#ionic-native/status-bar": "^4.17.0",
"#ionic-native/vibration": "^4.17.0",
"#ionic/storage": "^2.0.1",
"#ngx-translate/core": "6.0.1",
"#ngx-translate/http-loader": "0.0.3",
"#types/stripe": "^3.0.0",
"ajv": "^5.5.2",
"angular-svg-round-progressbar": "1.1.1",
"angular2-swiper": "^0.8.1",
"angularfire2": "^5.1.0",
"cordova-android": "^6.2.3",
"cordova-android-support-gradle-release": "^1.2.0",
"cordova-browser": "^4.1.0",
"cordova-ios": "^4.5.5",
"cordova-plugin-app-event": "^1.2.1",
"cordova-plugin-background-mode": "^0.7.2",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-facebook4": "^1.9.1",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-firebase-analytics": "^0.14.0",
"cordova-plugin-googleplus": "^5.3.2",
"cordova-plugin-inappbrowser": "^1.7.2",
"cordova-plugin-inapppurchase": "^1.2.0",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-media": "^5.0.2",
"cordova-plugin-nativeaudio": "^3.0.9",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.1",
"cordova-plugin-vibration": "^2.1.6",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-x-socialsharing": "^5.4.3",
"cordova-support-android-plugin": "^0.3.7",
"cordova-support-google-services": "^1.2.1",
"de.appplant.cordova.plugin.local-notification": "^0.8.5",
"dropbox": "^2.5.7",
"es6-promise": "^4.2.5",
"es6-promise-plugin": "^4.1.0",
"firebase": "^4.3.0",
"ionic-angular": "3.9.2",
"ionic-image-loader": "^4.1.1",
"ionic-plugin-keyboard": "^2.2.1",
"ionic3-calendar": "git+https://github.com/ReaperSoon/ionic3-calendar.git",
"ionicons": "4.4.8",
"jquery": "^3.2.1",
"localforage": "^1.7.3",
"localforage-cordovasqlitedriver": "^1.6.0",
"ng-imgcache": "^1.0.1",
"ng2-simple-timer": "^1.3.5",
"promise-polyfill": "6.0.2",
"rxjs": "5.4.3",
"setimmediate": "^1.0.5",
"stripe": "^4.25.0",
"superagent": "^3.7.0",
"sw-toolbox": "3.6.0",
"ts-md5": "^1.2.4",
"zone.js": "0.8.18"
},
"devDependencies": {
"#ionic/app-scripts": "3.2.1",
"#ionic/lab": "1.0.9",
"in-app-purchase": "^1.10.6",
"typescript": "2.4.0"
},
Can anyone help me to find what's wrong with my dependencies versions ?
Thanks in advance
try to update all plugins from ionic to the latest
https://www.npmjs.com/package/cordova-check-plugins
Install it globally:
$ npm install -g cordova-check-plugins
Then run from the root of your Cordova project. You can optionally update outdated plugins interactively or automatically, e.g.
$ cordova-check-plugins --update=auto
Your #ionic-native/core version of ^4.17 expects Angular 5, but you've listed dependencies for Angular 4 (^4.4.7).
You can upgrade to "ionic-angular": "3.9.8" and "#angular/core": "5.2.11"
Remember to update the other angular dependencies to the same version as well (#angular/common, #angular/compiler, etc.)
Note: Some of your other dependencies that rely on angular v4 might also need to be upgraded.

Asp.net Angular Template application Npm update does not work

I am trying to follow the documentation found here however it is going well. All of the packages that gets created with the application are out of date such as the #angular/compiler which really the version at the time of this post is 6.0.2 not 4.2.5 as listed below in the generated packages.json.
Things to note.
Angular core 2.1 is installed
Latest version of NPM and Node are installed
Visual Studio 2017 Community is installed
Operating System: Windows 10
With the packages being this out of date there are many angular things I can take advantage of. I have been looking around however I have not found any solutions that work.
Things I have tried:
npm update
npm update -D && npm update -S
npm cache clean
npm install -g #angular/cli#latest
My dependencies:
{
"name": "TestingApp",
"private": true,
"version": "0.0.0",
"scripts": {
"test": "karma start ClientApp/test/karma.conf.js"
},
"devDependencies": {
"#angular/animations": "4.2.5",
"#angular/common": "4.2.5",
"#angular/compiler": "4.2.5",
"#angular/compiler-cli": "4.2.5",
"#angular/core": "4.2.5",
"#angular/forms": "4.2.5",
"#angular/http": "4.2.5",
"#angular/platform-browser": "4.2.5",
"#angular/platform-browser-dynamic": "4.2.5",
"#angular/platform-server": "4.2.5",
"#angular/router": "4.2.5",
"#ngtools/webpack": "1.5.0",
"#types/chai": "4.0.1",
"#types/jasmine": "2.5.53",
"#types/webpack-env": "1.13.0",
"angular2-router-loader": "0.3.5",
"angular2-template-loader": "0.6.2",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^2.0.3",
"awesome-typescript-loader": "3.2.1",
"bootstrap": "3.3.7",
"chai": "4.0.2",
"css": "2.2.1",
"css-loader": "0.28.4",
"es6-shim": "0.35.3",
"event-source-polyfill": "0.0.9",
"expose-loader": "0.7.3",
"extract-text-webpack-plugin": "2.1.2",
"file-loader": "0.11.2",
"html-loader": "0.4.5",
"isomorphic-fetch": "2.2.1",
"jasmine-core": "2.6.4",
"jquery": "3.2.1",
"json-loader": "0.5.4",
"karma": "1.7.0",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-webpack": "2.0.3",
"preboot": "4.5.2",
"raw-loader": "0.5.1",
"reflect-metadata": "0.1.10",
"rxjs": "5.4.2",
"style-loader": "0.18.2",
"to-string-loader": "1.1.5",
"typescript": "2.4.1",
"url-loader": "0.5.9",
"webpack": "2.5.1",
"webpack-hot-middleware": "2.18.2",
"webpack-merge": "4.1.0",
"zone.js": "0.8.12"
}
}
Update dotnet --info
Product Information:
Version: 2.1.201
Commit SHA-1 hash: 7932dc6179
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.201\
Microsoft .NET Core Shared Framework Host
Version : 2.0.7
Build : 2d61d0b043915bc948ebf98836fefe9ba942be11

Cannot find type definition file for 'node'

I am getting strange errors after updating angular, webpack and typescript.
Any idea what I could be missing?
When I run the app with npm start I get the following errors:
[at-loader] Cannot find type definition file for 'hammerjs'.
[at-loader] Cannot find type definition file for 'node'.
[at-loader] src\app\app.component.ts:26:14
Cannot find name 'require'.
[at-loader] src\app\app.component.ts:30:15
Cannot find name 'require'.
Here are the dependencies:
"dependencies": {
"#angular/common": "2.4.4",
"#angular/compiler": "2.4.4",
"#angular/core": "2.4.4",
"#angular/forms": "2.4.4",
"#angular/http": "2.4.4",
"#angular/material": "2.0.0-beta.1",
"#angular/platform-browser": "2.4.4",
"#angular/platform-browser-dynamic": "2.4.4",
"#angular/platform-server": "2.4.4",
"#angular/router": "3.4.4",
"#angularclass/conventions-loader": "^1.0.13",
"#angularclass/hmr": "~1.2.2",
"#angularclass/hmr-loader": "~3.0.2",
"#ng-bootstrap/ng-bootstrap": "1.0.0-alpha.18",
"angular2-jwt": "0.1.28",
"angular2-moment": "1.1.0",
"auth0-lock": "10.10.1",
"bootstrap": "4.0.0-alpha.5",
"cky-meta": "^1.0.2",
"core-js": "^2.4.1",
"hammerjs": "2.0.8",
"http-server": "^0.9.0",
"ie-shim": "^0.1.0",
"intl": "^1.2.5",
"ng2-img-cropper": "0.7.7",
"ng2-page-scroll": "3.2.1",
"ng2-sharebuttons": "1.1.5",
"reflect-metadata": "^0.1.9",
"rxjs": "5.0.3",
"web-animations-js": "2.2.2",
"zone.js": "0.7.6"
},
"devDependencies": {
"#angular/compiler-cli": "~2.4.4",
"#types/chai": "3.4.34",
"#types/core-js": "^0.9.35",
"#types/es6-shim": "^0.31.32",
"#types/hammerjs": "^2.0.33",
"#types/jasmine": "^2.5.41",
"#types/node": "^6.0.60",
"#types/protractor": "^4.0.0",
"#types/selenium-webdriver": "2.53.39",
"#types/source-map": "^0.5.0",
"#types/uglify-js": "^2.0.27",
"#types/webpack": "^2.2.2",
"add-asset-html-webpack-plugin": "^1.0.2",
"angular-router-loader": "^0.5.0",
"angular2-template-loader": "^0.6.0",
"assets-webpack-plugin": "^3.5.1",
"awesome-typescript-loader": "~3.0.0-beta.18",
"bootstrap-loader": "2.0.0-beta.19",
"codelyzer": "~2.0.0-beta.4",
"copy-webpack-plugin": "^4.0.0",
"css-loader": "^0.26.0",
"exports-loader": "^0.6.3",
"expose-loader": "^0.7.1",
"file-loader": "^0.9.0",
"gh-pages": "^0.12.0",
"html-webpack-plugin": "^2.26.0",
"imports-loader": "^0.7.0",
"istanbul-instrumenter-loader": "1.2.0",
"jasmine-core": "^2.5.2",
"json-loader": "^0.5.4",
"karma": "^1.4.0",
"karma-chrome-launcher": "^2.0.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-mocha-reporter": "^2.2.2",
"karma-remap-coverage": "^0.1.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "2.0.1",
"ng2-facebook-sdk": "1.2.0",
"ngc-webpack": "^1.1.2",
"node-sass": "4.3.0",
"npm-run-all": "^4.0.1",
"parse5": "^3.0.1",
"postcss-loader": "1.2.2",
"protractor": "^4.0.14",
"raw-loader": "0.5.1",
"resolve-url-loader": "1.6.1",
"rimraf": "~2.5.4",
"sass-loader": "4.1.1",
"script-ext-html-webpack-plugin": "^1.5.0",
"source-map-loader": "^0.1.6",
"string-replace-loader": "^1.0.5",
"style-loader": "^0.13.1",
"to-string-loader": "^1.1.5",
"ts-helpers": "1.1.2",
"ts-node": "^2.0.0",
"tslint": "4.3.1",
"typedoc": "^0.5.5",
"typescript": "2.1.5",
"typings": "2.1.0",
"url-loader": "^0.5.7",
"v8-lazy-parse-webpack-plugin": "^0.3.0",
"webpack": "2.2.0",
"webpack-dev-middleware": "^1.9.0",
"webpack-dev-server": "2.2.0",
"webpack-dll-bundles-plugin": "^1.0.0-beta.5",
"webpack-md5-hash": "^0.0.5",
"webpack-merge": "~2.4.0"
},
"engines": {
"node": ">= 4.2.1",
"npm": ">= 3"
}
Try re-importing the #types/node package by running this in the Package Manager Console in Visual Studio:
npm i -D #types/node
If a specific version must be used, you can specify:
npm i -D #types/node#6.0.10
That seems more likely to be a problem of versions within the typings.json file. Can you try the following?
typings install dt~node --save
typings install dt~core-js --save
typings install dt~hammerjs --save
It could either be a mismatched ts-node version in which updating ts-node should fix it found here or it could be an incorrect tsconfig.json found here
If these don't work here are some links you may find useful:
https://github.com/shlomiassaf/angular2-modal/issues/213
VS2015: "Cannot find type definition" and "File not found" errors
In my case, after doing an npm update I was getting this error. It disappeared by restarting my node server :
npm start
You might need to apply multiple solutions to solve this issue!
STEP 1
You might need to install missing typings from #types
it's already present and still you are getting this error proceed to step 2
STEP 2
If you are using ts-loader you will need to upgrade this
STEP 3 (Not applicable to all)
In some cases it's the webpack versioning which causes this error; upgrading to webpack version, ts-node, awesome-typescript-loader etc will solve it for you
STEP 4 (Angular only)
If you have used core-js upgrade its version
In general solution varies for all however its the node modules version where you will need to play around a bit! It's more of hit and try
All the best!

Resources