1

So I just created my new Angular application and whenever I restore my packages by right-clicking package.json file and selecting Restore Packages option, I get these npm errors below. How do I resolve them?

I had a look at this link Npm Error - Windows NT - How to resolve but the solutions provided are based on the user's specific OS registry information.

I'm using a 64-bit OS. Running VS 2015 Update 3. I have Node JS installed and running the following commands confirms this:

  1. node -v: v6.10.3

  2. npm -v: v3.10.10

Unrelated third check:

  1. TypeScript is installed and is VS is running 2.3.3.0

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR! node v6.10.3 npm ERR! npm v3.10.10 npm ERR! path C:\Users\Linda\Angular2Test\Angular2Test\Angular2Test\node_modules.staging\source-map-support-b3871625 npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall rename npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Linda\Angular2Test\Angular2Test\Angular2Test\node_modules.staging\source-map-support-b3871625' -> 'C:\Users\Linda\Angular2Test\Angular2Test\Angular2Test\node_modules\source-map-support' npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules.staging\source-map-support-b3871625' -> 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\source-map-support' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! Please include the following file with any support request: npm ERR! C:\Users\Linda\Angular2Test\Angular2Test\Angular2Test\npm-debug.log angular-quickstart@1.0.0 C:\Users\User\Angular2Test\Angular2Test\Angular2Test

After going over Unable to npm install my package here are the following checks I did:

  1. I have a package.json file and it is not misspelled.

  2. I checked my devDependencies and the version that package.json file is running on seems to be 1.0.0 (run on via the lite server)

  3. Here is my devDependencies of my package.json file:

    "devDependencies": { "concurrently": "^3.2.0", "lite-server": "^2.2.2", "typescript": "~2.1.0",

        "canonical-path": "0.0.2",
        "tslint": "^3.15.1",
        "lodash": "^4.16.4",
        "jasmine-core": "~2.4.1",
        "karma": "^1.3.0",
        "karma-chrome-launcher": "^2.0.0",
        "karma-cli": "^1.0.1",
        "karma-jasmine": "^1.0.2",
        "karma-jasmine-html-reporter": "^0.2.2",
        "protractor": "~4.0.14",
        "rimraf": "^2.5.4",
    
        "@types/node": "^6.0.46",
        "@types/jasmine": "2.5.36"
      },
      "repository": {}
    

The error does state that this is not a problem with npm but it not being able to find a file. What file is this?

UPDATE: I noticed that the .staging folder is none existent in my project directory as per the below error.

npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\.staging\source-map-support-b3871625' -> 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\source-map-support'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\.staging\source-map-support-b3871625' -> 'C:\Users\User\Angular2Test\Angular2Test\Angular2Test\node_modules\source-map-support'
Harold_Finch
  • 682
  • 2
  • 12
  • 33

1 Answers1

0

I simply ran the following command and the error(s) went away.

npm install -g grunt
Harold_Finch
  • 682
  • 2
  • 12
  • 33