2

I want to install Angular 4.3.1 or 4.4.6 or something like that. Currently I am using Angular cli version 1.4.1. When I provide the command it install the latest Angular 5 version and latest Angular 5 run properly.

ng new myproject

How to I create Angular 4.4.6 version. I have tried to change in package.json file and provide this command.

npm install

The command execute without any errors. When I try to run I am getting the following errors.

Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)

I have also tries to delete the node_modules folder and run npm install command again. But the same errors. So my question is what is the proper way to install Angular 4 version?

4
  • looks like the problem is the node version installed, not the angular. Commented Dec 3, 2017 at 15:13
  • The Node version is 8.7.0 Commented Dec 3, 2017 at 15:20
  • Before you running 'npm install' delete 'node_modules' Commented Dec 3, 2017 at 16:32
  • you can check this answer stackoverflow.com/a/52067532/2275011 Commented Dec 17, 2018 at 19:06

1 Answer 1

1

The error you're getting is caused by incompatibilities of the versions in your package.json. Try this:

  1. Delete node_modules dir from your project
  2. Replace the dependencies and devDependencies sections in your package.json with the following: "dependencies": { "@angular/common": "^4.2.4", "@angular/compiler": "^4.2.4", "@angular/core": "^4.2.4", "@angular/forms": "^4.2.4", "@angular/http": "^4.2.4", "@angular/platform-browser": "^4.2.4", "@angular/platform-browser-dynamic": "^4.2.4", "@angular/router": "^4.2.4", "core-js": "^2.4.1", "rxjs": "^5.4.2", "zone.js": "^0.8.14" }, "devDependencies": { "@angular/cli": "1.4.0", "@angular/compiler-cli": "^4.2.4", "@angular/language-service": "^4.2.4", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "~3.1.1", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.3.2", "typescript": "~2.3.3" }
    1. Run npm install
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.