【问题标题】:Npm: Cannot call method 'charAt' of undefinedNpm:无法调用未定义的方法'charAt'
【发布时间】:2015-03-27 23:10:43
【问题描述】:

在项目中我们使用 travis

在我上次的 PR 中我遇到了一个错误:

$ npm install
npm ERR! git clone --template=/home/travis/.npm/_git-remotes/_templates --mirror git://github.com/*****/***-global.git /home/travis/.npm/_git-remotes/git-github-com-****-***-global-git-1c65c4d0
npm ERR! Linux 3.13.0-40-generic
npm ERR! argv "node" "/home/travis/.nvm/v0.10.38/bin/npm" "install"
npm ERR! node v0.10.38
npm ERR! npm  v2.7.4
npm ERR! Cannot call method 'charAt' of undefined
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/build/*****/*****-auth/npm-debug.log
The command "npm install" failed and exited with 1 during .

在开发机器上一切正常 我尝试使用 git+https / git:// 设置源 尝试为 travis 设置相同的节点/npm 版本 我什至尝试设置

os:
  - osx

同样的

谁能帮帮我?

【问题讨论】:

    标签: node.js git npm travis-ci


    【解决方案1】:

    它在 npm 版本 2.7.5 中得到修复,因为它写在 changelog https://github.com/npm/npm/blob/master/CHANGELOG.md, #7746 错误修复中。尝试更新 npm。

    【讨论】:

      【解决方案2】:

      此错误已在 npm 2.7.5 中修复

      所以我解决问题的方法是添加到 .travis.yml

      before_install:
        - "npm install -g npm@^2.7.5"
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-09-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多