OpenDocumenter icon indicating copy to clipboard operation
OpenDocumenter copied to clipboard

Unable to install OpenDocumenter globally (ENOENT no such file or directory, chmod 'C:\Users\user\AppData\Roaming\npm\node_modules\opendocumenter\src\cli.js')

Open blake-mealey opened this issue 3 years ago • 14 comments

Describe the bug Unable to install opendocumenter on Windows or WSL Ubuntu.

I have tried:

  • npx opendocumenter
  • npm i -g opendocumenter
  • sudo npm i -g opendocumenter
  • npm i --ignore-scripts -g opendocumenter

on both WSL Ubuntu and Windows 10

To Reproduce Steps to reproduce the behavior:

  1. Run one of the above commands
  2. See error

Expected behavior opendocumenter is installed

Desktop:

  • OS: Windows 10
  • Version: 0.5.0

Additional context Logs:

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

When I tried npm i --ignore-scripts -g opendocumenter the install was successful, but when I tried running the CLI I got:

opendocumenter: The term 'opendocumenter' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

blake-mealey avatar Sep 10 '20 22:09 blake-mealey

Thank you for opening your first issue! Please ensure you've read the CONTRIBUTING.md and CODE_OF_CONDUCT.md files.

github-actions[bot] avatar Sep 10 '20 22:09 github-actions[bot]

From a quick look at your codebase, it looks to me that the bin property in package.json is incorrect. I think it should point to src-engine/cli.js instead of src/cli.js. From a quick look it seems this was changed in this commit: b1cfca4ba2bcc254cf0cf4f4a75ea6195c4f4331

blake-mealey avatar Sep 10 '20 22:09 blake-mealey

On Debian, a non-root non-global install (npm install opendocumenter) give the same issue:

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /home/mdk/.../node_modules/opendocumenter/src/cli.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/home/mdk/.../node_modules/opendocumenter/src/cli.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

$ npm --version
6.14.8

JulienPalard avatar Oct 14 '20 14:10 JulienPalard

I have made this fix and published a forked version to @cspotcode/opendocumenter: https://www.npmjs.com/package/@cspotcode/opendocumenter

cspotcode avatar Oct 26 '20 17:10 cspotcode

@cspotcode Fork fixed it on OS X, thanks

alexschwarz89 avatar Oct 27 '20 08:10 alexschwarz89

"Unsupported engine" is not the cause.

On Tue, Oct 27, 2020, 5:52 AM Gokhan Ozgozen [email protected] wrote:

Seems like Unsupported engine for [email protected]: wanted: {"node":"<8.10.0"} (current: {"node":"14.6.0","npm":"6.14.6"}) is the root cause.

Above forked version works.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ouropencode/OpenDocumenter/issues/19#issuecomment-717121689, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC35OHXKBAQMIDIXNOZMCDSM2J4TANCNFSM4RGAFVJA .

cspotcode avatar Oct 27 '20 15:10 cspotcode

@cspotcode Fork fixed it in my docker test:

FROM node:15.0.1-alpine3.10
RUN npm install -g @cspotcode/[email protected]

nathanabercrombie avatar Oct 27 '20 20:10 nathanabercrombie

Someone else already made a pull request which was closed. In November I commented that it should be re-opened. https://github.com/ouropencode/OpenDocumenter/pull/11

cspotcode avatar Jan 07 '21 22:01 cspotcode

Someone else already made a pull request which was closed. In November I commented that it should be re-opened. #11

Thank you. I just prepared one too but if there already is one I don't see the necessity to finish it :D

JoshuaDietz avatar Jan 07 '21 22:01 JoshuaDietz

still not installable same error messages as before. OS. archlinux

RokkuCode avatar Apr 04 '21 19:04 RokkuCode

I'm running into similar error message while installing this library on macOS BigSur:

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/opendocumenter/src/cli.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/opendocumenter/src/cli.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:

Any pointers? This has rendered this library useless at this point for me.

suyashcjoshi avatar Jun 09 '21 19:06 suyashcjoshi

Try this: https://github.com/ouropencode/OpenDocumenter/issues/19#issuecomment-716705615

Also, take a look at the pull request which fixes this issue: https://github.com/ouropencode/OpenDocumenter/pull/11

cspotcode avatar Jun 09 '21 19:06 cspotcode

Same problem but the forked version mentioned above worked for me. Thanks!

richi0 avatar Jun 17 '23 12:06 richi0

nvm use 16.20.2 is what fixed this same issue for me, give it a try

LadyNay avatar Apr 16 '24 07:04 LadyNay