[英]NPM Global Install Fails
此CLI的全局安裝開始失敗,我不確定為什么。
git clone https://github.com/superflycss/cli
cd cli
npm i -g
日志文件是10K行日志,但這是最后的內容:
7353 verbose stack Error: ENOENT: no such file or directory, rename '/home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@superflycss/cli-5549c074/node_modules/@babel/code-frame' -> '/home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@babel/code-frame-78217d7a'
7354 verbose cwd /home/ole/SuperflyCSS/cli
7355 verbose Linux 4.15.0-45-generic
7356 verbose argv "/home/ole/.nvm/versions/node/v11.0.0/bin/node" "/home/ole/.nvm/versions/node/v11.0.0/bin/npm" "i" "-g"
7357 verbose node v11.0.0
7358 verbose npm v6.7.0
7359 error path /home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@superflycss/cli-5549c074/node_modules/@babel/code-frame
7360 error code ENOENT
7361 error errno -2
7362 error syscall rename
7363 error enoent ENOENT: no such file or directory, rename '/home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@superflycss/cli-5549c074/node_modules/@babel/code-frame' -> '/home/ole/.nvm/versions/node/v11.0.0/lib/node_modules/.staging/@babel/code-frame-78217d7a'
7364 error enoent This is related to npm not being able to find a file.
7365 verbose exit [ -2, true ]
我嘗試按照此處的說明刪除所有全局模塊 ,然后重新安裝。 但是,即使完全刷新了本地模塊(Nuke local node_modules
),它仍然會失敗。
還嘗試了:
須藤rm -fr /home/ole/.npm-packages/*
然后npm i -g
,結果仍然相同。
我認為可能是這個錯誤:
也許您可以嘗試通過npmjs注冊表通過npm在全球范圍內安裝superflycss CLI,而不是克隆superflycss存儲庫並嘗試從源代碼進行構建。 例如:
npm i -g @superflycss/cli
然后像這樣使用它:
Usage: sfc [options] [command]
希望有幫助!
docker run -it node bash
git clone https://github.com/superflycss/cli
cd cli
npm i -g
效果很好!
root@c3adb3ae08aa:/cli# sfc --version
1.0.0
root@c3adb3ae08aa:/cli# sfc --help
Usage: sfc [options] [command]
SuperflyCSS Command Line Interface
[more stuff here]
嘗試清除您的node_modules全局緩存和本地目錄。
通過升級到節點v11.9.0和NPM v6.7.0修復了此問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.