I am trying to compile an already built angular application. Upgrading to latest version is not possible but already built app should just compile fine.
my package.config file is
{
"name": "my name",
"version": "1.0.0",
"description": "what does this do?",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.10",
"@angular/common": "^5.2.10",
"@angular/compiler": "^5.2.10",
"@angular/compiler-cli": "^5.2.10",
"@angular/core": "^5.2.10",
"@angular/forms": "^5.2.10",
"@angular/http": "^5.2.10",
"@angular/platform-browser": "^5.2.10",
"@angular/platform-browser-dynamic": "^5.2.10",
"@angular/platform-server": "^5.2.10",
"@angular/router": "^5.2.10",
"angular2-focus": "^1.1.0",
"bootstrap": "^3.3.7",
"chart.js": "^2.7.2",
"classlist.js": "^1.1.20150312",
"core-js": "^2.4.1",
"file-saver": "^1.3.3",
"font-awesome": "^4.7.0",
"fullcalendar": "^3.2.0",
"fullcalendar-scheduler": "^1.5.1",
"jquery": "^3.1.1",
"moment": "^2.18.1",
"primeng": "^5.2.4",
"rxjs": "^5.2.0",
"typescript": "^2.8.1",
"web-animations-js": "^2.2.2",
"zone.js": "^0.8.5"
},
"devDependencies": {
"@angular/cli": "^1.6.6",
"@angular/compiler-cli": "^5.2.10",
"@types/core-js": "^0.9.34",
"@types/jasmine": "^2.5.35",
"@types/jquery": "^2.0.34",
"@types/lodash": "^4.14.40",
"@types/moment": "^2.13.0",
"@types/node": "^6.0.45",
"@types/q": "0.0.32",
"@types/selenium-webdriver": "^2.53.32",
"codelyzer": "^4.2.1",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"lodash": "^4.16.2",
"primeng": "^4.0.1",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~5.9.1",
"typescript": "^2.8.1"
}
}
I am getting this error when I run ng build
Your global Angular CLI version (14.0.0) is greater than your local version (1.6.6). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
@angular/[email protected] requires typescript@'>=2.4.2 <2.7.0' but 2.9.2 was found instead. Using this version can result in undefined behaviour and difficult to debug problems.
Please run the following command to install a compatible version of TypeScript.
npm install typescript@'>=2.4.2 <2.7.0'
To disable this warning run "ng set warnings.typescriptMismatch=false".
Date: 2022-11-23T02:55:08.478Z
Hash: 9743454dc3930ee3a8f6 Time: 4325ms chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered] chunk {main} main.bundle.js, main.bundle.js.map (main) 303 bytes [initial] [rendered] chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 323 bytes [initial] [rendered] chunk {scripts} scripts.bundle.js, scripts.bundle.js.map (scripts) 675 kB [initial] [rendered] chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 588 kB [initial] [rendered]ERROR in src/app/nets/nets-configuration/configuration-view/configuration-view.component.ts(12,23): error TS2307: Cannot find module 'primeng/table'.
My Angular and node installation has
npm i shows this error
npm i --force has some warnings
I can see the package folder inside node_modules
I have deleted the node_modules folder and tried again but got this error
CodePudding user response:
Looks like you have not done npm install on your root folder as it throws that it cannot find the module 'primeng' which is in the package.json
try to do
npm i
CodePudding user response:
You have to remove node_modules folder and package-lock file then run npm i and it will work. Thanks