0

I'm trying to create a laravel nova tool. And I'm running this command.

npm run dev

But instead of compiling I'm getting this error.

> @ dev C:\wamp64\www\project
> npm run development

npm ERR! file bash 
npm ERR! path bash 
npm ERR! code ELIFECYCLE 
npm ERR! errno ENOENT 
npm ERR! syscall spawn bash 
npm ERR! @ dev: `npm run development` 
npm ERR! spawn bash ENOENT 
npm ERR! 
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: 
npm ERR!     C:\Users\Name\AppData\Roaming\npm-cache\_logs\2019-04-03T13_41_19_035Z-debug.log

C:\wamp64\www\project>

enter image description here It would be great help if someone know how to fix this.

This is my error log file,

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 info lifecycle @~dev: @
7 verbose lifecycle @~dev: unsafe-perm in lifecycle true
8 verbose lifecycle @~dev: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\wamp64\www\project\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\PuTTY\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\TortoiseSVN\bin;C:\xampp\php;C:\xampp\mysql\bin;C:\xampp\perl\bin;C:\ProgramData\ComposerSetup\bin;C:\Program Files (x86)\Plantronics\Spokes3G\;C:\wamp64\bin\php\php7.2.10;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin;C:\Users\Name\AppData\Local\Microsoft\WindowsApps;C:\Users\Name\AppData\Roaming\Composer\vendor\bin;C:\Users\Name\AppData\Roaming\npm;C:\Users\Name\AppData\Local\Yarn\bin;
9 verbose lifecycle @~dev: CWD: C:\wamp64\www\project
10 silly lifecycle @~dev: Args: [ '-c', 'npm run development' ]
11 info lifecycle @~dev: Failed to exec dev script
12 silly lifecycle @~dev: Returned: code: -4058  signal: null
13 info lifecycle @~dev: Failed to exec dev script
14 verbose stack Error: @ dev: `npm run development`
14 verbose stack spawn bash ENOENT
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
14 verbose stack     at onErrorNT (internal/child_process.js:407:16)
14 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
15 verbose pkgid @
16 verbose cwd C:\wamp64\www\project
17 verbose Windows_NT 10.0.17134
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
19 verbose node v10.15.0
20 verbose npm  v6.4.1
21 error file bash
22 error path bash
23 error code ELIFECYCLE
24 error errno ENOENT
25 error syscall spawn bash
26 error @ dev: `npm run development`
26 error spawn bash ENOENT
27 error Failed at the @ dev script.
27 error This is probably not a problem with npm. There is likely additional logging output above.
28 verbose exit [ 1, true ]

As instructed I downladed bash from this link and after unzipping copied bash.exe to C:\Users\Name\AppData\Roaming\npm as described. Now getting this error,

> @ dev C:\wamp64\www\project
> npm run development

bash: sh: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Name\AppData\Roaming\npm-cache\_logs\2019-04-03T14_36_05_198Z-debug.log
4
  • 1
    Have you checked that debug log for more information? Commented Apr 3, 2019 at 13:56
  • yes but it's bit confusing for me I uploaded it too Commented Apr 3, 2019 at 14:04
  • Just add path to sh.exe container folder to %path% variable (for example "c:\Program Files\Git\bin" ). Commented Sep 30, 2020 at 13:38
  • @SalientBrain thanks so much was a long time ago and now I open CMD with admin and when comes any error usually delete node_modules an npm install Commented Oct 1, 2020 at 5:37

2 Answers 2

1

Your system does not know bash.

This is either because it's not installed or it's not in %PATH% or %PATH is not available to npm (environment). It can also happen when you access scripts which are ment to be global but actually are only available inside a specific project path.

First make sure the appropriate binaries are installed, then try to use absolute paths instead.

Most probably, because you are on Windows, you don't have bash installed or npm does not know where it is.

Sign up to request clarification or add additional context in comments.

2 Comments

Did it and updated the issue. Thanks so much anyway :(
@vimuth it's still the same problem but with the next program: You need to install sh. Why you want to execute all the Unix stuff on a Windows machine? You should just use Docker and download a Linux container...
1

I had this problem on windows 10. Try instead $ npm run start

all errors are resloved by this:

$ npm install --save-dev babel-loader babel-core

.babelrc file { "presets": ["@babel/preset-env"] }

1 Comment

Thanks bro I'll chk

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.