简体   繁体   中英

npm install error 1, trouble shooting failed

I've tried all the fixes I can find, but cannot seem to get npm to function. Hoping someone may have additional insight around this error:

Fixes I have tried:

  • Adding %AppData%\npm to PATH
  • Complete reinstall, including node, and all PATH
  • Changing the prefix from -g to --global
  • Changing the NPM Version
  • Install prisma and reinstalling prisma

npm version: 8.11.0 node version: v16.16.0 Using 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.

This is the Error I get in the log:

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.

After 3 days of no avail, I finally figured it out.

If you are using npm install on windows it will throw errors.

My first fix to this was yarn which allowed me to run just fine.

Then, I decided to do a dual-boot ubuntu and have had zero issues with npm or any node packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM