npm update check failed

前端 未结 14 1058
太阳男子
太阳男子 2020-11-30 05:47

Last night I tried to update my node and npm, it seemed to have been successful, however ever since then I have been getting this same error any time I try and run any npm c

相关标签:
14条回答
  • 2020-11-30 05:58

    Try running the command prompt Run as administrator mode, if that not solved your issue delete the .config folder under c:\user\<name of the user>\ and then try running the command prompt Run as administrator mode.

    0 讨论(0)
  • 2020-11-30 05:59

    I have a fixed that worked for me on OSX Catalina:

    -------------------------------------
    /var/log/nodejs/nodejs.log
    -------------------------------------
    > node server.js
    
    €â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
    │             npm update check failed              │
    │       Try running with sudo or get access        │
    │       to the local update config store via       │
    │ sudo chown -R $USER:$(id -gn $USER) /tmp/.config │
    └──────────────────────────â”
    

    I ran the following code in the terminal and as suggested here: sudo chown -R $USER:$(id -gn $USER) /tmp/.config & redeployed to my instance which still showed a degraded state.

    I did this several times and this did not result in success.

    Since I had a duplicate instance that was in the ready, so I didn't think it was a permissions problem on my local machine.

    The following fix worked for me (please note that my code is deployed to ebs through AWS CodePipeline":

    1. Delete package-lock.json from your express/node project.
    2. Run npm i
    3. git add && git commit -m "your commit msg" && git push

    In your aws console, go to code pipeline and verify your code deployed successfully.

    Navigate to Elastic Beanstalk. If your code pushed successfully, you should see your instance updating.

    After this the state of your EBS environment should be in the ready state.

    Hope this helps someone out.

    0 讨论(0)
  • 2020-11-30 06:01

    Following is the answer from github

    Fix for windows, I got this message :

    npm update check failed Try running with sudo or get access to the local update config store via sudo chown -R $USER:$(id -gn $USER) C:\Users.config

    so I went on to C:\Users.config and deleted the "configstore" folder. once I done this, next time a ran npm start, the folder was re-generated, and error stopped

    Fix for OSX:

    After two hours of try-and-fail I managed to solve the issue as follows:

    1. go to folder /usr/local/lib/node_modules/
    2. right-click on the folder node_modules > go to Get Info
    3. update the permissions > add yourself and administrator account and set "read and write" for both
    4. run in the terminal "npm install packageName"
    5. if you still get the error, go to the same folder /usr/local/lib/node_modules/ and within the folder node_modules, update in the same way the permissions for the new package folder
    6. try to run again in the terminal "npm install packageName"

    That worked for me! Hope it could help somebody.

    0 讨论(0)
  • 2020-11-30 06:02

    I had the same issue on AWS server, i used this command to update the config permissions and the npm command worked smooth.

    sudo chown -R $USER:$(id -gn $USER) ~/.config

    0 讨论(0)
  • 2020-11-30 06:02

    If you don't want to chown your entire .config directory (which contains configuration files from other programs), try:

    sudo chown -R $USER:$(id -gn $USER) "/home/skaestle/.config/configstore/"
    
    0 讨论(0)
  • 2020-11-30 06:02

    Running the cmd with admin rights once was enough for me. Just did npm version.

    After that it worked again also without admin rights. I did not delete anything.

    {
      npm: '6.13.6',
      node: '12.14.1',
      ...
    }
    
    0 讨论(0)
提交回复
热议问题