簡體   English   中英

我在 linux 中安裝 npm 時出現一堆錯誤

[英]I have bunch of error installing npm in linux

我搜索了很多論壇已經准備好找到類似的東西,我發現了類似的東西,但沒有一個對我有幫助。 讓你知道怎么回事。

我剛剛安裝了新的 ubuntu,並在那里安裝了 vim、git 和 node.js。 現在我也想安裝 npm,但后來出現錯誤。 一堆他們tbh:

kuba@ubuntu:~/lgv$ npm install
npm WARN deprecated tsml@1.0.1: no longer maintained
npm WARN addRemoteGit Error: Command failed: git config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:275:12)
npm WARN addRemoteGit     at emitTwo (events.js:126:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:214:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:925:16)
npm WARN addRemoteGit     at Socket.stream.socket.on (internal/child_process.js:346:11)
npm WARN addRemoteGit     at emitOne (events.js:116:13)
npm WARN addRemoteGit     at Socket.emit (events.js:211:7)
npm WARN addRemoteGit     at Pipe._handle.close [as
    _onclose] (net.js:567:12)
npm WARN addRemoteGit  git+https://bitbucket.org/lgv-g12/lgv-config.git resetting remote /home/kuba/.npm/_git-remotes/git-https-bitbucket-org-lgv-g12-lgv-config-git-d9c0735f because of error: { Error: Command failed: git config --get remote.origin.url
npm WARN addRemoteGit 
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:275:12)
npm WARN addRemoteGit     at emitTwo (events.js:126:13)
npm WARN addRemoteGit   at ChildProcess.emit (events.js:214:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:925:16)
npm WARN addRemoteGit    at Socket.stream.socket.on (internal/child_process.js:346:11)
npm WARN addRemoteGit     at emitOne (events.js:116:13)
npm WARN addRemoteGit   at Socket.emit (events.js:211:7)
npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:567:12)
npm WARN addRemoteGit killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit  signal: null,
npm WARN addRemoteGit   cmd: 'git config --get remote.origin.url' }
npm ERR! git clone
    --template=/home/kuba/.npm/_git-remotes/_templates --mirror https://bitbucket.org/lgv-g12/lgv-config.git /home/kuba/.npm/_git-remotes/git-https-bitbucket-org-lgv-g12-lgv-config-git-d9c0735f: Cloning into bare repository '/home/kuba/.npm/_git-remotes/git-https-bitbucket-org-lgv-g12-lgv-config-git-d9c0735f'...
npm ERR! git clone --template=/home/kuba/.npm/_git-remotes/_templates
    --mirror https://bitbucket.org/lgv-g12/lgv-config.git /home/kuba/.npm/_git-remotes/git-https-bitbucket-org-lgv-g12-lgv-config-git-d9c0735f: remote: Invalid username or password
npm ERR! git clone
    --template=/home/kuba/.npm/_git-remotes/_templates --mirror https://bitbucket.org/lgv-g12/lgv-config.git /home/kuba/.npm/_git-remotes/git-https-bitbucket-org-lgv-g12-lgv-config-git-d9c0735f: fatal: Authentication failed for 'https://bitbucket.org/lgv-g12/lgv-config.git/'
npm ERR! Linux
    4.18.0-15-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0 npm ERR! npm  v3.5.2
npm ERR! code 128

npm ERR! Command failed: git clone
    --template=/home/kuba/.npm/_git-remotes/_templates --mirror https://bitbucket.org/lgv-g12/lgv-config.git /home/kuba/.npm/_git-remotes/git-https-bitbucket-org-lgv-g12-lgv-config-git-d9c0735f
npm ERR! Cloning into bare repository '/home/kuba/.npm/_git-remotes/git-https-bitbucket-org-lgv-g12-lgv-config-git-d9c0735f'...
npm ERR! remote: Invalid username or password
npm ERR! fatal: Authentication failed for 'https://bitbucket.org/lgv-g12/lgv-config.git/'
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!     /home/kuba/lgv/npm-debug.log
kuba@ubuntu:~/lgv$

也許你知道我搞砸了什么。 它已經是我的第二個 linux 機器,我從中得到了這些錯誤,沒有什么能真正幫助我解決這個問題。

在使用 apt-get 的 Ubuntu 機器(和 Debian 等)上,通過以下方式安裝 npm:

sudo apt-get install npm

你使用了命令

npm install

此命令用於安裝 node.js 項目的依賴項,如 package.json 所述。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM