npm install throws 和錯誤告訴 node 不是一個可識別的命令 (npm install throws and error telling node is not a recognized command)


問題描述

npm install throws 和錯誤告訴 node 不是一個可識別的命令 (npm install throws and error telling node is not a recognized command)

system throwing node not found error

我已將節點添加到 PATH。
我已嘗試重新安裝節點並重新啟動系統。
節點 ‑‑version = 6.13.7
npm ‑‑version = 12.14.1


參考解法

方法 1:

Whenever your PC can't pick up on node as a command, it's usually a PATH issue.

I note that you say you have already added it to Path, but it's worth checking a few things:

  1. Did you add it to User Path or System Path?
  2. How long is your Path parameter? If it's too long, you may need to break it down into two or more variables. Reference here: https://www.howtogeek.com/266621/how‑to‑make‑windows‑10‑accept‑file‑paths‑over‑260‑characters/
  3. Have you added Git to your Path as well? If not, go ahead and install Git Bash: https://gitforwindows.org/
  4. If restarting hasn't done the trick of refreshing your env variables for whatever reason, you can force it along by opening Powershell as admin, and running refreshenv
  5. If you are able to run node commands, but npm isn't able to run them on your behalf, it may be a permissions issue. Consider running the very same command, but in an elevated permissions CMD. (Run CMD as admin)

(by NandanTim)

參考文件

  1. npm install throws and error telling node is not a recognized command (CC BY‑SA 2.5/3.0/4.0)

#npm #core-js #node.js






相關問題

TFS 構建中的 npm install 拋出“未找到:git” (npm install in TFS build throws "not found: git")

找不到模塊“電子” (Cannot find module 'electron')

使用 npm 進行生成器角度安裝時出現問題 (Trouble during generator-angular installation with npm)

使用 node.js 從谷歌云存儲中刪除多個對象 (Delete multiple objects fron google cloud storage using node.js)

VS Task Runner Explorer - Node Sass 找不到綁定 (VS Task Runner Explorer - Node Sass could not find a binding)

有什麼東西可以跟踪我安裝的 npm 包並在不同的開發環境中恢復它們嗎?(如“恢復 NuGet 包”) (Is there anything that can keep track of my installed npm packages and restore them on a different dev environment ? (like "Restore NuGet packages"))

角度材質工具欄不繼承自角度材質 (Angular material toolbar not inheriting from angular materials)

npm install throws 和錯誤告訴 node 不是一個可識別的命令 (npm install throws and error telling node is not a recognized command)

從代理後面登錄的無服務器框架? (Serverless Framework Login From Behind a Proxy?)

構建工具結構 - NPM、Grunt 和 Wordpress (Build tools structure - NPM, Grunt with Wordpress)

如何解決 Linux 中的“npm ERR!code ELIFECYCLE”錯誤? (How to solve "npm ERR! code ELIFECYCLE" error in Linux?)

如何在 Angular 中導入“數字”:“^1.2.6”? (How to import "numeric": "^1.2.6" in Angular?)







留言討論