返回介绍

Common Errors

发布于 2019-05-30 13:06:43 字数 5628 浏览 942 评论 0 收藏 0

No compatible version found

You have an outdated npm. Permission Error

npm ERR! code EPERM
npm ERR! code EACCES

  • Fix the permissions of your cache with sudo chown -R $(whoami) "$HOME/.npm".
  • Try again with sudo. e.g. sudo npm install express -g. (You'll probably need to fix cache permissions afterwards, as above).
  • Travis projects using 0.8 can't upgrade to npm 2

    In your .travis.yml replace this:

    before_install:
    - npm install -g npm@latest

    with this:

    before_install:
    - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
    - npm install -g npm@latest

    This suggestion is based on Error: ENOENT, stat 'C:\Users\<user>\AppData\Roaming\npm' on Windows 7

    This is a consequence of No space

    npm ERR! Error: ENOSPC, write
    

    You are trying to install on a drive that either has no space, or has no permission to write.

    • Free some disk space or
    • Set the tmp folder somewhere with more space: npm config set tmp /path/to/big/drive/tmp or
    • Build Node yourself and install it somewhere writable with lots of space.

    No git

    npm ERR! not found: git
    ENOGIT
    

    You need to running a Vagrant box on Windows fails due to path length issues

    npm only uses git: and ssh+git: URLs for GitHub repos, breaking proxies

    SSL Error

    npm ERR! Error: 7684:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:787:
    

    You are trying to talk SSL to an unencrypted endpoint. More often than not, this is due to a SSL-intercepting proxy

    Unsolved. See Not found / Server error

    npm http 404 https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.0.tgz
    npm ERR! fetch failed https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.0.tgz
    npm ERR! Error: 404 Not Found
    
    npm http 500 https://registry.npmjs.org/phonegap
    

    • It's most likely a temporary npm registry glitch. Check Invalid JSON
      Error: Invalid JSON
      
      npm ERR! SyntaxError: Unexpected token <
      
      npm ERR! registry error parsing json
      
      • Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later.
      • This can be caused by corporate proxies that give HTML responses to package.json requests. Check npm's proxy Many ENOENT / ENOTEMPTY errors in output

        npm is written to use resources efficiently on install, and part of this is that it tries to do as many things concurrently as is practical. Sometimes this results in race conditions and other synchronization issues. As of npm 2.0.0, a very large number of these issues were addressed. If you see ENOENT lstat, ENOENT chmod, ENOTEMPTY unlink, or something similar in your log output, try updating npm to the latest version. If the problem persists, look at cb() never called! when using shrinkwrapped dependencies

        Take a look at npm login errors

        Sometimes npm login fails for no obvious reason. The first thing to do is to log in at npm hangs on Windows at addRemoteTarball

        Check if you have two temp directories set in your .npmrc:

        > npm config ls -l
        

        Look for lines defining the tmp config variable. If you find more than one, remove all but one of them.

        See Other

        • Some strange issues can be resolved by simply running npm cache clean and trying again.
        • If you are having trouble with npm install, use the -verbose option to have more details.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文