11

I'm pulling our code down from our repository to a new laptop. Our project was built on Angular 5 last year. Of course, the new laptop has the latest and greatest Angular CLI, NodeJS, and NPM tools install, and Angular 6 was just released. The laptop has Node 8.11.2, NPM 5.6.0, and Angular CLI 6.0.3.

When I run "npm install" to get the "node_modules" folder on my new laptop for this project, I'm getting all kinds of errors and warnings and unable to create the node_modules folder successfullyenter image description here (see image attached). What can I do to get this project running. I don't necessarily care about upgrading to Angular 6 at this time. I simply need to continue to be able to run and develop this project.

Our package.json:

{
  "name": "my-first-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --environment=local --open",
    "build": "ng build --prod aot=false",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.2.0",
    "@angular/cdk": "^5.2.4",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/material": "^5.2.4",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@ngui/map": "^0.20.2",
    "@types/googlemaps": "^3.30.7",
    "bootstrap": "^4.0.0",
    "core-js": "^2.4.1",
    "google-maps-coords": "^1.0.0",
    "jquery": "^3.3.1",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.19"
  },
  "devDependencies": {
    "@angular/cli": "~1.7.1",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "font-awesome": "^4.7.0",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "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": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3"
  }
}
7
  • 2
    Try deleting the node_modules and execute npm install Commented May 22, 2018 at 20:40
  • Try running rm -rf node_modules and npm cache clean and do npm install Commented May 22, 2018 at 20:41
  • @Vikas, yes, that's what I'm trying to do. There's no node_modules checked in with our code, so I'm trying to run "npm install" to generate for this existing project. Commented May 22, 2018 at 20:43
  • @GopakumarGopalan Yes, I've done that, many times. Same results every time. Commented May 22, 2018 at 20:43
  • 1
    @Andy It seems like you are trying the right things. Have you tried these in an administrator console? Commented May 22, 2018 at 20:53

3 Answers 3

15

I faced a similar issue and removing the package-lock.json and running npm install solved it for me.

Sign up to request clarification or add additional context in comments.

Comments

8

First Clean the cache

npm cache clean --force

Then Install It

npm install

Comments

-4

It is actually very simple. Just do a sudo npm install node_modules if you are using Mac/Linux or just a npm install node_modules on windows.

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.