Issue
I have a problem working with jhipster My installation of java, and node worked fine. Also installed the hipster fine. Now when I work on a project. I see a npm error I have attached the log file
0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js 1 info using [email protected] 2 info using [email protected] 3 timing npm:load:whichnode Completed in 0ms 4 timing config:load:defaults Completed in 2ms 5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms 6 timing config:load:builtin Completed in 3ms 7 timing config:load:cli Completed in 2ms 8 timing config:load:env Completed in 1ms 9 timing config:load:file:C:\Projects\jhip1\cplan\.npmrc Completed in 1ms 10 timing config:load:project Completed in 3ms 11 timing config:load:file:C:\Users\MyPC\.npmrc Completed in 0ms 12 timing config:load:user Completed in 1ms 13 timing config:load:file:C:\Users\MyPC\AppData\Roaming\npm\etc\npmrc Completed in 0ms 14 timing config:load:global Completed in 0ms 15 timing config:load:validate Completed in 1ms 16 timing config:load:credentials Completed in 1ms 17 timing config:load:setEnvs Completed in 1ms 18 timing config:load Completed in 15ms 19 timing npm:load:configload Completed in 15ms 20 timing npm:load:mkdirpcache Completed in 1ms 21 timing npm:load:mkdirplogs Completed in 0ms 22 verbose title npm run clean-www 23 verbose argv "run" "clean-www" 24 timing npm:load:setTitle Completed in 2ms 25 timing config:load:flatten Completed in 3ms 26 timing npm:load:display Completed in 5ms 27 verbose logfile logs-max:10 dir:C:\Users\MyPC\AppData\Local\npm-cache\_logs 28 verbose logfile C:\Users\MyPC\AppData\Local\npm-cache\_logs\2022-08-31T00_33_10_177Z-debug-0.log 29 timing npm:load:logFile Completed in 8ms 30 timing npm:load:timers Completed in 1ms 31 timing npm:load:configScope Completed in 0ms 32 timing npm:load Completed in 33ms 33 silly logfile start cleaning logs, removing 2 files 34 timing command:run Completed in 20ms 35 verbose stack Error: spawn bash ENOENT 35 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19) 35 verbose stack at onErrorNT (node:internal/child_process:478:16) 35 verbose stack at processTicksAndRejections (node:internal/process/task_queues:83:21) 36 verbose pkgid [email protected] 37 verbose cwd C:\Projects\jhip1\cplan 38 verbose Windows_NT 10.0.19043 39 verbose node v16.17.0 40 verbose npm v8.15.0 41 error code ENOENT 42 error syscall spawn bash 43 error path C:\Projects\jhip1\cplan 44 error errno -4058 45 error enoent spawn bash ENOENT 46 error enoent This is related to npm not being able to find a file. 46 error enoent 47 verbose exit -4058 48 timing npm Completed in 78ms 49 verbose code -4058 50 error A complete log of this run can be found in: 50 error C:\Users\MyPC\AppData\Local\npm-cache\_logs\2022-08-31T00_33_10_177Z-debug-0.log
These are my env setting, which I see mismatched when I look at the log and what I don't understand is why node is installed again, when I already have it in my machine
C:\Projects\jhip1\cplan>where mvn INFO: Could not find files for the given pattern(s). C:\Projects\jhip1\cplan>where npm C:\Program Files\nodejs\npm C:\Program Files\nodejs\npm.cmd C:\Projects\jhip1\cplan>where node C:\Program Files\nodejs\node.exe C:\Projects\jhip1\cplan>where java C:\Program Files\Eclipse Adoptium\jdk-11.0.16.101-hotspot\bin\java.exe C:\Projects\jhip1\cplan>echo %JAVA_HOME% C:\Program Files\Eclipse Adoptium\jdk-11.0.16.101-hotspot C:\Projects\jhip1\cplan> C:\Projects\jhip1\cplan>node -v v16.17.0 C:\Projects\jhip1\cplan>java -version openjdk version "11.0.16.1" 2022-08-12 OpenJDK Runtime Environment Temurin-11.0.16.1+1 (build 11.0.16.1+1) OpenJDK 64-Bit Server VM Temurin-11.0.16.1+1 (build 11.0.16.1+1, mixed mode) C:\Projects\jhip1\cplan>npm --v 8.15.0 C:\Projects\jhip1\cplan>jhipster --version INFO! Using bundled JHipster 7.9.2
I have had this problem fthe or last 8 hours , so I had cleaned the npm cache and manually deleted the directory as well using npm cache clean and manually deleted C:\Users\MyPC\AppData\Local\npm-cache
I also deleted the following directory to clean it all from Users/MyPC/.m2/repository
Solution
A few things helped
I found I had two jHipster version installed so I removed any local copies of it
I removed global hipster and installed the latest version
Both of these steps (or may be the step 2) helped me get rid of npm run clean-www Error
Answered By - Ramesh Pandey
Answer Checked By - Marie Seifert (JavaFixing Admin)