When I run `npm install`, it returns with `ERR! code EINTEGRITY` (npm 5.3.0)

后端 未结 27 1468
闹比i
闹比i 2020-11-28 02:29

I am getting this error while running sudo npm install. On my server, npm was installed earlier. I\'ve tried to delete the package-lock.json file,

相关标签:
27条回答
  • 2020-11-28 02:35

    Run the commands below on your project..

    npm rm -rf node_modules && npm rm package-lock.json && npm rm -rf ~/.npm && npm install --update-binary --no-shrinkwrap
    
    0 讨论(0)
  • 2020-11-28 02:36

    None of the above answers worked for me. The solution to my issue was to change the way the snapshot dependency was consumed inside the package.json. Use the following template to pull in the snapshot dependency that you need

    "dependency": "git+http://github.com/[pathtoproject].git#[branchname]",
    
    0 讨论(0)
  • 2020-11-28 02:37

    As a workaround, follow the below steps:

    1. Go to the project directory
    2. Remove the node_modules directory: rm -rf node_modules
    3. Remove package-lock.json file: rm package-lock.json
    4. Clear the cache: npm cache clean --force
    5. Run npm install --verbose If after following the above steps still the issue exists then please provide us the output of installation command with --verbose.
    0 讨论(0)
  • 2020-11-28 02:37

    I faced same issue. Plus while I was trying to resolve from picking solutions from other devs, I faced few more issues like one listed here.

    Angular 9 ng new myapp gives error The Schematic workflow failed

    https://medium.com/@codewin/npm-warn-deprecated-request-2-88-2-b6da20766fd7

    Finally after trying cache clean and verify and reinstall node of different versions and npm update, nvm and many other solution like set proxy and better internet connection, I still could not arrive to a resolve.

    What worked for me is : I browsed a bit inside my C:\Users--- folder, I found package-lock.json and .npmrc files. I deleted those and reinstalled angular and tried. npm install and uninstall of different modules started working.

    0 讨论(0)
  • 2020-11-28 02:38

    See https://github.com/npm/npm/issues/16861

    This worked for me:
    npm cache verify

    Then I re-ran:
    npm install -g create-react-app

    And it installed like as expected: Issue resolved


    Other solutions mentioned in the github issue include:

    npm cache clean --force

    OR

    Deleting npm and npm-cache folders in Users%username%\AppData\Roaming (windows 7) and running npm install

    OR

    Update npm by via npm i -g npm

    OR

    Delete package-lock.json

    OR

    npm cache verify

    OR

    npm cache clean

    OR

    Do these steps to fix the problem:

    1. Find all outdated packages and update theme:
      npm outdated -g
      sudo npm i -g outDatedPKG
    2. Upgrade npm to latest version with:
      sudo npm i -g npm
    3. Delete package-lock.json file.
    4. Delete _cacache directory in ~/.npm: npm cache verify
    5. Every time I get that error, do steps 2 & 3.
    6. If you still get the error, clear npm's cache:
      npm cache clean --force

    OR

    1. Add proxy to .npmrc in ~ directory:

    proxy=http://localhost:8123
    https-proxy=http://localhost:8123

    1. Try again! slow internet connection and censorship may cause this ugly problem.

    OR

    npm cache clear --force && npm install --no-shrinkwrap --update-binary

    OR

    npm config set package-lock false

    0 讨论(0)
  • 2020-11-28 02:38

    I had a very similar problem, and in my case it worked by doing:

    npm clean
    

    This is the nuclear option since it clears every package from the cache as expained here.

    0 讨论(0)
提交回复
热议问题