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```
Depending on what kind of NPM package you are looking for.
If you just want to create a library, then export functions properly, and remove main function. In
package.json
, you usemain
field.If you want to create a CLI script, and header
#!
to the script, and bin the script name inpackage.json
inbin
field.Either way, you should write a good documentation on why you would want to share it, and how to use it.
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.
You can try
npm link
first, and run withnpx
, before publishing it.About the error, make use
package.json
isOr