运行npm install时出现以下错误
npm WARN `git config --get remote.origin.url` returned wrong result (git://github.com/substack/esprima)
npm WARN `git config --get remote.origin.url` returned wrong result (git@github.com:substack/esprima)
npm ERR! git clone git@github.com:substack/esprima Cloning into bare repository 'C:\Users\ebic\AppData\Roaming\npm-cache\_git-remotes\git-github-com-s
ubstack-esprima-622885ba'...
npm ERR! git clone git@github.com:substack/esprima ssh: connect to host github.com port 22: Bad file number
npm ERR! git clone git@github.com:substack/esprima fatal: Could not read from remote repository.
npm ERR! git clone git@github.com:substack/esprima
npm ERR! git clone git@github.com:substack/esprima Please make sure you have the correct access rights
但是我可以使用
手动克隆回购git clone https://github.com/substack/esprima
问题似乎是npm在运行git尝试使用git @或git://获取依赖项时 因此,我运行以下
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
所以我的git config -l包含
url.https://.insteadof=git://
http.sslverify=false
url.https://github.com/.insteadof=git@github.com:
但是得到同样的错误。仍然使用git @或git://
获取依赖关系任何想法都可能出错?提前谢谢。
这是fill package.json
{
"name": "corewebreact",
"version": "0.0.0",
"description": "",
"repository": "",
"private": true,
"src": "src",
"test": "test",
"dist": "dist",
"mainInput": "main",
"mainOutput": "main",
"dependencies": {
"react": "~0.11.2",
"react-router": "^0.7.0",
"react-slider": "^0.1.2",
"react-typeahead": "^1.0.0",
"remove": "^0.1.5",
"sugar": "^1.4.1"
},
"devDependencies": {
"6to5": "^1.10.10",
"6to5-loader": "^0.2.3",
"chai": "^1.9.2",
"colors": "^1.0.3",
"connect-redis": "~2.1.0",
"css-loader": "~0.9.0",
"es6-loader": "^0.2.0",
"express": "^4.9.8",
"express-session": "~1.9.1",
"grunt": "~0.4.5",
"grunt-6to5": "^1.0.1",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-connect": "~0.8.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-debug-task": "^0.1.5",
"grunt-express-server": "^0.4.19",
"grunt-istanbul-coverage": "^0.1.0",
"grunt-karma": "~0.8.3",
"grunt-mocha": "^0.4.11",
"grunt-mocha-test": "^0.12.2",
"grunt-notify": "^0.4.1",
"grunt-open": "~0.2.3",
"grunt-preprocess": "^4.0.0",
"grunt-react": "^0.10.0",
"grunt-webpack": "~1.0.8",
"http-proxy": "~1.5.3",
"http-proxy-nocrash": "~0.1.2",
"imports-loader": "^0.6.3",
"inject-loader": "^1.0.0",
"istanbul": "^0.3.2",
"istanbul-instrumenter-loader": "^0.1.2",
"jest": "^0.1.37",
"jshint-loader": "~0.8.0",
"jsx-loader": "~0.11.0",
"karma": "~0.12.21",
"karma-chrome-launcher": "~0.1.4",
"karma-firefox-launcher": "~0.1.3",
"karma-jasmine": "~0.1.5",
"karma-mocha": "^0.1.9",
"karma-phantomjs-launcher": "~0.1.3",
"karma-script-launcher": "~0.1.0",
"karma-sinon-chai": "^0.2.0",
"karma-webpack": "~1.2.2",
"less": "^1.7.5",
"less-loader": "^0.7.7",
"load-grunt-tasks": "~0.6.0",
"mocha": "^2.0.1",
"mocha-istanbul": "^0.2.0",
"module": "0.0.1",
"morgan": "^1.4.0",
"q": "~1.0.1",
"random-words": "0.0.1",
"react-hot-loader": "^0.4.5",
"react-test-utils": "0.0.1",
"redis": "^0.12.1",
"request": "~2.47.0",
"rewire": "^2.1.3",
"rewire-webpack": "^1.0.0",
"should": "^4.2.1",
"sinon": "^1.11.1",
"sinon-chai": "^2.6.0",
"style-loader": "~0.8.0",
"sweetjs-loader": "^0.1.0",
"underscore": "^1.7.0",
"url-loader": "~0.5.5",
"webpack": "^1.4.13",
"webpack-dev-server": "~1.6.5",
"ws": "~0.4.32"
}
}