簡體   English   中英

npm(版本5.5.1)安裝錯誤

[英]npm (version 5.5.1) install errors

我已經安裝了9.2.0版的節點和5.5.1版的npm

在命令行上,我要安裝軟件包:

$ npm install express --save
npm WARN bookstore@1.0.0 No repository field.

npm ERR! path C:\Users\ad\Projects\bookstore\node_modules\bytes
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 
'C:\Users\ad\Projects\bookstore\node_modules\bytes' -> 
'C:\Users\ad\Projects\bookstore\node_modules\.bytes.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ad\AppData\Roaming\npm-cache\_logs\2018-03-
14T06_36_04_014Z-debug.log

這是什么意思? 也許我應該卸載節點版本9並恢復到LTS -version 8? 以及如何在Windows中做到這一點?

拜托,我需要幫助; 先感謝您!

編輯:可能是由於互聯網連接速度慢引起的; npm not being able to find a file.

編輯2:我能夠卸載節點版本9.2.0,然后安裝版本8.10.0 :-(仍然是相同的錯誤消息!

以下命令的首次使用

touch .npmignore

然后安裝Express

npm install express --save

我找到了解決方案,但這真是愚蠢! 讓我解釋一下:我已經使用Visual Studio Code已有幾個月了,它是內置的命令行(bash)。 從來沒有任何問題! 但現在; VS Code一定有問題,給出了這些錯誤。

我嘗試了一種替代方法:Git-Bash命令窗口和單獨的Sublime Text3。它起作用了! 我可以安裝所需的所有依賴項,而不會出現任何錯誤或警告!

有人可以解釋我使用VS Code時遇到的奇怪行為嗎?

暫無
暫無

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

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