簡體   English   中英

npm安裝錯誤1,故障排除失敗

[英]npm install error 1, trouble shooting failed

我已經嘗試了所有可以找到的修復程序,但似乎無法將 npm 轉換為 function。 希望有人可能對這個錯誤有更多的了解:

我嘗試過的修復:

  • 將 %AppData%\npm 添加到 PATH
  • 完成重新安裝,包括節點和所有 PATH
  • 將前綴從 -g 更改為 --global
  • 更改 NPM 版本
  • 安裝 prisma 並重新安裝 prisma

npm 版本:8.11.0 節點版本:v16.16.0 使用VS Code

 PS C:\Users\txxxx\SaaStime> npm install npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. npm ERR: code 1 npm ERR: path C.\Users\txxxx\SaaStime npm ERR, command failed npm ERR. command C:\WINDOWS\system32\cmd.exe /d /s /c prisma generate npm ERR! 'prisma' is not recognized as an internal or external command, npm ERR! operable program or batch file.

這是我在日志中得到的錯誤:

61 timing command:install Completed in 82ms
62 verbose stack Error: command failed
62 verbose stack     at ChildProcess.<anonymous> (C:\Program 
Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:63:27)
62 verbose stack     at ChildProcess.emit (node:events:527:28)
62 verbose stack     at maybeClose (node:internal/child_process:1092:16)
62 verbose stack     at Process.ChildProcess._handle.onexit 
(node:internal/child_process:302:5)
63 verbose pkgid nextacular@1.2.0-Beta
64 verbose cwd C:\Users\toril\SaaStime
65 verbose Windows_NT 10.0.22000
66 verbose node v16.16.0
67 verbose npm  v8.11.0
68 error code 1
69 error path C:\Users\toril\SaaStime
70 error command failed
71 error command C:\WINDOWS\system32\cmd.exe /d /s /c prisma generate
72 error 'prisma' is not recognized as an internal or external command,
72 error operable program or batch file.

經過3天無濟於事,我終於弄明白了。

如果您使用npm install在 windows 上,它將引發錯誤。

我對此的第一個修復是yarn ,它讓我運行得很好。

然后,我決定做一個雙引導 ubuntu 並且 npm 或任何節點包的問題為零。

暫無
暫無

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

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