2017-07-07 236 views
-2

我嘗試了許多不同的方法來安裝this包: NPM安裝雲打印 NPM安裝https://github.com/postmen/node-cloud-print.git 等等...無法安裝的NPM包

每次我得到下面的輸出時間:

`npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url 
 
npm WARN addRemoteGit 
 
npm WARN addRemoteGit  at ChildProcess.exithandler (child_process.js:211:12) 
 
npm WARN addRemoteGit  at emitTwo (events.js:106:13) 
 
npm WARN addRemoteGit  at ChildProcess.emit (events.js:191:7) 
 
npm WARN addRemoteGit  at maybeClose (internal/child_process.js:885:16) 
 
npm WARN addRemoteGit  at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 
 
npm WARN addRemoteGit git+ssh://[email protected]/postmen/google-api-nodejs-client.git resetting remote C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46 because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url 
 
npm WARN addRemoteGit 
 
npm WARN addRemoteGit  at ChildProcess.exithandler (child_process.js:211:12) 
 
npm WARN addRemoteGit  at emitTwo (events.js:106:13) 
 
npm WARN addRemoteGit  at ChildProcess.emit (events.js:191:7) 
 
npm WARN addRemoteGit  at maybeClose (internal/child_process.js:885:16) 
 
npm WARN addRemoteGit  at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) 
 
npm WARN addRemoteGit killed: false, 
 
npm WARN addRemoteGit code: 1, 
 
npm WARN addRemoteGit signal: null, 
 
npm WARN addRemoteGit cmd: 'git -c core.longpaths=true config --get remote.origin.url' } 
 
npm ERR! git clone --template=C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://[email protected]/postmen/google-api-nodejs-client.git C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46: Cloning into bare repository 'C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46'... 
 
npm ERR! git clone --template=C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://[email protected]/postmen/google-api-nodejs-client.git C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46: Host key verification failed. 
 
npm ERR! git clone --template=C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://[email protected]/postmen/google-api-nodejs-client.git C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46: fatal: Could not read from remote repository. 
 
npm ERR! git clone --template=C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://[email protected]/postmen/google-api-nodejs-client.git C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46: 
 
npm ERR! git clone --template=C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://[email protected]/postmen/google-api-nodejs-client.git C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46: Please make sure you have the correct access rights 
 
npm ERR! git clone --template=C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://[email protected]/postmen/google-api-nodejs-client.git C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46: and the repository exists. 
 
npm ERR! Windows_NT 10.0.14393 
 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "cloud-print" 
 
npm ERR! node v7.4.0 
 
npm ERR! npm v4.0.5 
 
npm ERR! code 128 
 
npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror ssh://[email protected]/postmen/google-api-nodejs-client.git C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46 
 
npm ERR! Cloning into bare repository 'C:\Users\User\AppData\Roaming\npm-cache\_git-remotes\git-ssh-git-github-com-postmen-google-api-nodejs-client-git-21a89f46'... 
 
npm ERR! Host key verification failed. 
 
npm ERR! fatal: Could not read from remote repository. 
 
npm ERR! 
 
npm ERR! Please make sure you have the correct access rights 
 
npm ERR! and the repository exists. 
 
npm ERR! 
 
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!  D:\Tmunot\npm-debug.log`

我也試圖目錄下載到node_modules和在package.json中手動配置它,但我沒有成功做到這一點。

任何想法?

+0

什麼輸出?缺少一些文字 – lumio

+0

我在縮進中遇到了問題,現在沒關係 – Ariel

+0

如果是鏈接:嘗試直接將其內容添加到您的問題中,並將其標記爲代碼 – lumio

回答

0

並非所有軟件包都支持從github安裝。如果是available in npm (correct package now linked),我會贊成的。

如果在npm中不可用,那麼知道它看起來有一個構建過程(假設存在grunt命令)。您應該克隆它,構建它並使用NPM來提取「內置」副本。

你會使用下面介紹一次建成方法:npm install <folder>

+0

做到這一點https://www.npmjs.com/包/雲打印意味着它在npm中可用? – Ariel

+0

事實上,是的,這似乎是github項目的正確包裝。 –

+0

但它不起作用 – Ariel

0

我認爲問題出在你的NPM版本。對於這個軟件包,npm版本太新了。包cloud-print已過時。沒有人支持這個軟件包。也許npm會支持5.1版本的這種類型的包。

JFYI:npm i cloud-print結果在不同的節點+ NPM版本:

  • 節點v8.1.3 NPM v5.0.3錯誤
  • 節點V7.10.0 NPM V4.2.0工作
  • 節點v6.11.0 NPM v3.10.10工作
  • 節點v4.4.7 NPM v2.15.8工作

解決方案使用Node.js的第6節

您可以使用Node.js v6嗎?在這個最新的支持版本上,你可以使用這個軟件包。