DEV Community

[Comment from a deleted post]
Collapse
 
syn profile image
norman

I followed tutorials but they dont work. I put the header #! into it and add the bin. I dont know how to test if it works without publishing it, so i published it. It doesnt work and gives this error.

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path C:\Users\namar\AppData\Roaming\npm\node_modules\subscrapetest\node subscrape.js
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, chmod 'C:\Users\namar\AppData\Roaming\npm\node_modules\subscrapetest\node subscrape.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\namar\AppData\Roaming\npm-cache\_logs\2020-02-13T22_11_56_826Z-debug.log```


Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

You can try npm link first, and run with npx, before publishing it.

About the error, make use package.json is

{
  "bin": {
    "<SCRIPT_NAME>": "subscrape.js"
  }
}

Or

{
  "bin": "subscrape.js"
}