question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running scripts in %PATH%: Uncaught NotFound

See original GitHub issue

Describe the bug I’m working on both Windows 10 and MacOS machines. Now running on Windows, I’m trying to setup denon script to call denopack which is in my %HOME%\.deno\bin and already included in %PATH% but got error: Uncaught NotFound: The system cannot find the file specified. (os error 2)

To Reproduce

  1. Create denon.json
"scripts": {
        "build": {
            "cmd": "denopack -c denopack.config.ts",
            "desc": "bundle my client.tsx file",
            "watch": false
        }
}
  1. Check that denopack is installed in %PATH%
where denopack
C:\Users\qua_o\.deno\bin\denopack.cmd

denopack --version
denopack/0.9.0 windows-x86_64 deno-1.3.3
  1. Run denon build

Expected behavior It should run denopack -c denopack.config.ts

Configuration or Project If applicable, add your denon configuration file or project so we can accurately test our solution.

Screenshots

denon build     
[*] [main] v2.4.0
[!] [#0] starting `denopack -c denopack.config.ts`
error: Uncaught NotFound: The system cannot find the file specified. (os error 2)
    at unwrapResponse (rt\10_dispatch_json.js:24:13)
    at sendSync (rt\10_dispatch_json.js:51:12)
    at opRun (rt\40_process.js:20:12)
    at Object.run (rt\40_process.js:104:17)
    at Runner.execute (https://deno.land/x/denon@2.4.0/src/runner.ts:169:17)
    at Object.exe (https://deno.land/x/denon@2.4.0/src/runner.ts:45:21)
    at Daemon.start (https://deno.land/x/denon@2.4.0/src/daemon.ts:62:29)
    at Daemon.iterate (https://deno.land/x/denon@2.4.0/src/daemon.ts:165:32)
    at iterate.next (<anonymous>)
    at https://deno.land/x/denon@2.4.0/denon.ts:162:18

Setup

  • OS: Windows 10
  • Deno version: 1.3.3
  • Denon version: 2.4.0

Additional context It can’t neither find and run denon itself in %PATH%.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
notfilippocommented, Sep 30, 2020

I think this could be an issue related to Deno.run. I will look into this.

0reactions
hong4rccommented, Dec 7, 2020

Window 10: 19042.630

$ deno --version 
deno 1.5.4 (bc79d55, release, x86_64-pc-windows-msvc)
v8 8.8.278.2
typescript 4.0.5

$ denon -v
[*] [main] v2.4.4

Create denopack.ts file:

console.log('this is denopack');
console.log(Deno.args);

and install it:

$ deno install denopack.ts
Check file:///C:/Users/path/to/denopack.ts
✅ Successfully installed denopack
{
  "$schema": "https://deno.land/x/denon/schema.json",
  "scripts": {
    "start": {
      "cmd": "denopack -c denopack.config.ts",
      "desc": "run my app.ts file"
    }
  }
}

Let run

$ denon start
[*] [main] v2.4.4
[*] [daem] watching path(s): *.*
[*] [daem] watching extensions: ts,tsx,js,jsx,json
[!] [#0] starting `denopack -c denopack.config.ts`
this is denopack
[ "-c", "denopack.config.ts" ]
[*] [daem] clean exit - waiting for changes before restart

image

Hmmm! No error 😃

Can you change denopack -c denopack.config.ts to echo %PATH% or where denopack and check output.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bash script not found although it is in the $PATH
The script is in the /home/francois/scripts directory. I can easily run it from within this directory. It just works. Now I run the ......
Read more >
script not found even though it's in PATH
How come first.sh isn't found when I'm in my home directory? I have tried logging out and in again! linux · terminal ·...
Read more >
Run shell commands in Deno | The JS runtimes
Deno's core runtime comes with an easy way to asynchronously run shell commands and get the output. The run command is present in...
Read more >
Creating a Subprocess | Manual
subprocess.ts <somefile> [file content] $ deno run --allow-run ./subprocess.ts non_existent_file.md Uncaught NotFound: No such file or directory (os error ...
Read more >
Hardhat errors | Ethereum development environment for ...
You are trying to run Hardhat outside of a Hardhat project. ... Please double check your script's path. ... Running a script resulted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found