2

I checked few similar posts on here and other places but was not able to figure out. Never done Angular but got instructed to install npm and run an angular project I never used before. Here are the details

On my MacBookPro, I have an existing Angular project I never worked in before. I open it in VSCode and here is the structure

enter image description here

If I check version of my npm, I get following:

Node 10.8.0

npm 6.2.0

, then I go to the parent folder of the src folder (so folder that contains the src folder) and issue:

npm install

, I get following output with the error. Same error is in the log file generated:

mycomp:MyProj nbnex$ npm i
WARN tarball tarball data for angular-tree-component@5.2.1 (sha1-6GFJ7dp3tKYSvYAb/EVjK+zOYGQ=) seems to be corrupted. Trying one more time.
WARN tarball tarball data for angular-tree-component@5.2.1 (sha1-6GFJ7dp3tKYSvYAb/EVjK+zOYGQ=) seems to be corrupted. Trying one more time.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/@angular-devkit/core/node_modules/fsevents):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/Users/dbnex/source/MyProj/MyProj/node_modules/.staging/fsevents-d35eda14/node_modules/yallist' -> '/Users/dbnex/source/MyProj/MyProj/node_modules/.staging/yallist-2c29e2bb'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/watchpack/node_modules/fsevents):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/Users/dbnex/source/MyProj/MyProj/node_modules/.staging/fsevents-6a393e92/node_modules/set-blocking' -> '/Users/dbnex/source/MyProj/MyProj/node_modules/.staging/set-blocking-5346d4b2'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/Users/dbnex/source/MyProj/MyProj/node_modules/.staging/fsevents-a915511c/node_modules/process-nextick-args' -> '/Users/dbnex/source/MyProj/MyProj/node_modules/.staging/process-nextick-args-7b3b7565'

npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting angular-tree-component@5.2.1:
npm ERR! Verification failed while extracting angular-tree-component@5.2.1:
npm ERR! sha1-6GFJ7dp3tKYSvYAb/EVjK+zOYGQ= integrity checksum failed when using sha1: wanted sha1-6GFJ7dp3tKYSvYAb/EVjK+zOYGQ= but got sha512-EUet5nra7Ia1J4AkdJR6ToUFZHPbN9uybPpv+wx5/jo8lch5ezvh/5MQSShxIeU2bvsv4YpcSqgEq/6iBBfgpQ== sha1-dRAb4fP7cqda60ct3CvKQ5zMJxY=. (178201 bytes)

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dbnex/.npm/_logs/2018-10-05T18_04_47_761Z-debug.log
kenorb
  • 155,785
  • 88
  • 678
  • 743
pixel
  • 9,653
  • 16
  • 82
  • 149

2 Answers2

3

Delete node_modules folder. Use rimraf to delete the folder faster:

npm install rimraf -g
rimraf node_modules

Then do

 npm install

Make sure that you close VS Code application. Sometimes it will cause errors if the folder is open in any application.

Arun
  • 3,701
  • 5
  • 32
  • 43
1

Delete the node_modules and package-lock.json file.

Run npm cache clear --force

The try again.

James Wiseman
  • 29,946
  • 17
  • 95
  • 158