Version angular compile needs to be greater but mine is greater


#1

Hi all,
I’ve been trying to bundle my nativescript angular app with webpack by following the instructions given here and also here but to no avail.

when I run tns build android --bundle, I encountered the following error:
C:\Users\admin\Documents\Native\kreditoApp\node_modules@ngtools\webpack\src\ngtools_api.js:39
throw new Error('Version of @angular/compiler-cli needs to be 2.3.1 or greater. ’
^
Error: Version of @angular/compiler-cli needs to be 2.3.1 or greater. Current version is “6.0.6”.

Here’s my package.json:

{
“dependencies”: {
@angular/animations”: “~6.0.0”,
@angular/common”: “~6.0.0”,
@angular/compiler”: “~6.0.0”,
@angular/core”: “~6.0.0”,
@angular/forms”: “~6.0.0”,
@angular/http”: “~6.0.0”,
@angular/platform-browser”: “~6.0.0”,
@angular/platform-browser-dynamic”: “~6.0.0”,
@angular/router”: “~6.0.0”,
“nativescript-angular”: “^6.0.0”,
“nativescript-background-http”: “^3.2.7”,
“nativescript-camera”: “^4.0.2”,
“nativescript-feedback”: “^1.2.0”,
“nativescript-local-notifications”: “^2.0.4”,
“nativescript-mediafilepicker”: “^1.0.7”,
“nativescript-push-notifications”: “^1.1.4”,
“nativescript-theme-core”: “^1.0.4”,
“nativescript-ui-dataform”: “^3.6.1”,
“nativescript-ui-listview”: “^3.5.8”,
“reflect-metadata”: “~0.1.8”,
“rxjs”: “~6.0.0 || >=6.1.0”,
“tns-core-modules”: “^4.1.0”,
“tns-platform-declarations”: “^4.0.0”,
“zone.js”: “^0.8.26”
},
“devDependencies”: {
@angular/compiler-cli”: “^6.0.6”,
@ngtools/webpack”: “~1.8.2”,
“angular-router-loader”: “^0.8.5”,
“awesome-typescript-loader”: “^5.2.0”,
“babel-traverse”: “^6.26.0”,
“babel-types”: “^6.26.0”,
“babylon”: “6.4.5”,
“copy-webpack-plugin”: “~4.0.1”,
“css-loader”: “~0.28.7”,
“extract-text-webpack-plugin”: “~3.0.0”,
“lazy”: “1.0.11”,
“nativescript-dev-typescript”: “^0.7.1”,
“nativescript-dev-webpack”: “^0.9.2”,
“nativescript-worker-loader”: “~0.8.1”,
“raw-loader”: “~0.5.1”,
“resolve-url-loader”: “~2.1.0”,
“typescript”: “~2.7.2”,
“uglifyjs-webpack-plugin”: “~1.1.6”,
“webpack”: “~3.8.1”,
“webpack-bundle-analyzer”: “^2.8.2”,
“webpack-sources”: “~1.0.1”
}
}


#2

You need Webpack version 4.6.0.

Update webpack to 4.6.0
Run the command “./node_modules/.bin/update-ns-webpack --configs --deps”


#3

hi,

i solved it with
tns platform remove android
npm cache clean --force
delete the node_modules and hooks folder then npm install

But now i got this error “application entry point file not found. please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.” I check my package.json in app folder said main : main.js and i check main.js exists.