繁体   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