Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm ERR! code 236 npm ERR! git dep preparation failed #2852

Closed
richierockskool opened this issue May 20, 2023 · 29 comments
Closed

npm ERR! code 236 npm ERR! git dep preparation failed #2852

richierockskool opened this issue May 20, 2023 · 29 comments

Comments

@richierockskool
Copy link

npm install -g homebridge-inkbird-wifi-gateway
npm ERR! code 236
npm ERR! git dep preparation failed
npm ERR! command /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/######/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code ENOTDIR
npm ERR! npm ERR! syscall rename
npm ERR! npm ERR! path /Users/######/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway
npm ERR! npm ERR! dest /Users/######/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w
npm ERR! npm ERR! errno -20
npm ERR! npm ERR! ENOTDIR: not a directory, rename '/Users/######/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway' -> '/Users/######/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w'
npm ERR!

Mac OS Monterey 12.6.6

Paste your log here, between the backticks. It can be:
  - npm --verbose output,
  - or contents of npm-debug.log,
  - or output of node-gyp rebuild --verbose.
Include the command you were trying to run.

This should look like this:

>npm --verbose
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   'C:\\...\\node\\13.9.0\\x64\\node.exe',
npm verb cli   'C:\\...\\node\\13.9.0\\x64\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@6.13.7
npm info using node@v13.9.0

Usage: npm <command>
(...)
@cclauss
Copy link
Contributor

cclauss commented May 20, 2023

Please provide the full error log.

npm ERR! npm ERR! ENOTDIR: not a directory, rename '/Users/######/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway' -> '/Users/######/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w'
npm ERR!

Please mkdir -p /Users/######/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway and try again.

@richierockskool
Copy link
Author

richierockskool commented May 20, 2023 via email

@cclauss
Copy link
Contributor

cclauss commented May 20, 2023

So, given that the command run was npm and the log does not mention gyp, why open an issue in this repo?

Did you try the mkdir suggestion above?

@richierockskool
Copy link
Author

richierockskool commented May 20, 2023

Yes, I did with the same result, I just can not get this error solved, I thought this was the route to take.

Where do I find the definitions or the explanation for "Code 236"?

Update: Thank you!
Your previous method has shortened the error, still failing, but getting closer!

CMD: npm install -g homebridge-inkbird-wifi-gateway@1.0.9

npm ERR! code ENOENT
npm ERR! path /usr/local/lib/node_modules/homebridge-inkbird-wifi-gateway/node_modules/homebridge-inkbird-wifi-gateway
npm ERR! enoent ENOENT: Cannot cd into '/usr/local/lib/node_modules/homebridge-inkbird-wifi-gateway/node_modules/homebridge-inkbird-wifi-gateway'
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! /Users/richjagger/.npm/_logs/2023-05-20T15_44_26_911Z-debug-0.log

Operation failed. Please review log for details.

@cclauss
Copy link
Contributor

cclauss commented May 20, 2023

% npm doctor
% npm explain homebridge-inkbird-wifi-gateway
% npm explore homebridge-inkbird-wifi-gateway

@richierockskool
Copy link
Author

richierockskool commented May 20, 2023

I think we are getting very close...

npm doctor comes up with this...how do you add that $PATH?

Check Value Recommendation/Notes
npm ping ok
npm -v not ok Use npm v9.6.7
node -v ok current: v18.16.0, recommended: v18.16.0
npm config get registry ok using default registry (https://registry.npmjs.org/)
git executable in PATH ok /usr/bin/git
global bin folder in PATH not ok Error: Add /Users/richjagger/.npm-packages/bin to your $PATH
Perms check on cached files ok
Perms check on local node_modules ok
Perms check on global node_modules ok
Perms check on local bin folder ok
Perms check on global bin folder ok
npm WARN verifyCachedFiles Content garbage-collected: 3 (506357 bytes)
npm WARN verifyCachedFiles Cache issues have been fixed
Verify cache contents ok verified 959 tarballs
npm ERR! Some problems found. See above for recommendations.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/richjagger/.npm/_logs/2023-05-20T16_02_41_910Z-debug-0.log

@cclauss
Copy link
Contributor

cclauss commented May 20, 2023

export PATH=~/.npm-packages/bin:$PATH

@cclauss
Copy link
Contributor

cclauss commented May 20, 2023

% npm upgrade --global npm

You should try asking questions to https://chat.openai.com

@richierockskool
Copy link
Author

Sorry, I figured it out, before I could pull the comment...

Here is the latest from the npm doctor...

Check Value Recommendation/Notes
npm ping ok
npm -v ok current: v9.6.7, latest: v9.6.7
node -v ok current: v20.2.0, recommended: v20.2.0
npm config get registry ok using default registry (https://registry.npmjs.org/)
git executable in PATH ok /usr/bin/git
global bin folder in PATH ok /Users/richjagger/.npm-packages/bin
Perms check on cached files ok
Perms check on local node_modules ok
Perms check on global node_modules ok
Perms check on local bin folder ok
Perms check on global bin folder ok
Verify cache contents ok verified 1386 tarballs

@richierockskool
Copy link
Author

And still can not get past this?

npm install -g homebridge-inkbird-wifi-gateway
Debugger attached.
npm WARN tar ENOENT: Cannot cd into '/Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway/node_modules/homebridge-inkbird-wifi-gateway'
npm WARN tarball tarball data for homebridge-inkbird-wifi-gateway@git+ssh://git@github.com/richierockskool/homebridge-inkbird-wifi-gateway.git#f689c4a594eafe31c826c9c707615a86544ecf16 (null) seems to be corrupted. Trying again.
npm WARN tar ENOENT: Cannot cd into '/Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway/node_modules/homebridge-inkbird-wifi-gateway'
npm WARN tarball tarball data for homebridge-inkbird-wifi-gateway@git+ssh://git@github.com/richierockskool/homebridge-inkbird-wifi-gateway.git#f689c4a594eafe31c826c9c707615a86544ecf16 (null) seems to be corrupted. Trying again.
npm ERR! code ENOENT
npm ERR! path /Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway/node_modules/homebridge-inkbird-wifi-gateway
npm ERR! enoent ENOENT: Cannot cd into '/Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway/node_modules/homebridge-inkbird-wifi-gateway'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

@richierockskool
Copy link
Author

richierockskool commented May 20, 2023

I think this is the issue?

undefined@undefined
/Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/node_modules/homebridge-inkbird-wifi-gateway

And back to this error

CMD: npm install -g homebridge-inkbird-wifi-gateway@1.0.9

npm ERR! code ENOENT
npm ERR! path /usr/local/lib/node_modules/homebridge-inkbird-wifi-gateway/node_modules/homebridge-inkbird-wifi-gateway
npm ERR! enoent ENOENT: Cannot cd into '/usr/local/lib/node_modules/homebridge-inkbird-wifi-gateway/node_modules/homebridge-inkbird-wifi-gateway'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

@richierockskool
Copy link
Author

The latest new error:

npm ERR! code EISDIR
npm ERR! syscall rename
npm ERR! path /Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway
npm ERR! dest /Users/richjagger/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w
npm ERR! errno -21
npm ERR! EISDIR: illegal operation on a directory, rename '/Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway' -> '/Users/richjagger/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w'

@cclauss
Copy link
Contributor

cclauss commented May 21, 2023

cd ~/.npm-packages/lib/node_modules
mv homebridge-inkbird-wifi-gateway_junk homebridge-inkbird-wifi-gateway_junk
touch homebridge-inkbird-wifi-gateway

@richierockskool
Copy link
Author

richierockskool commented May 21, 2023

That did this...

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /Users/richjagger/.npm-packages/lib/node_modules/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/Users/richjagger/.npm-packages/lib/node_modules/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

@richierockskool
Copy link
Author

After everything it still comes back to this?

npm ERR! code EISDIR
npm ERR! syscall rename
npm ERR! path /Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway
npm ERR! dest /Users/richjagger/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w
npm ERR! errno -21
npm ERR! EISDIR: illegal operation on a directory, rename '/Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway' -> '/Users/richjagger/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w'

@richierockskool
Copy link
Author

richierockskool commented May 25, 2023 via email

@richierockskool
Copy link
Author

richierockskool commented May 25, 2023 via email

@cclauss
Copy link
Contributor

cclauss commented May 25, 2023

Go to https://chat.openai.com and ask these two questions:

  • On Windows, how can I set richjagger to be the owner of the directory /Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/node_modules and all files inside that directory?
  • On Windows, how can I set the directory /Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/node_modules/.nodemon-xd0s1R7V/node_modules/fsevents/build to be readable and writable?

@richierockskool
Copy link
Author

I am on a mac, but I will try, I could not get into that web site when I tried last time.

@cclauss
Copy link
Contributor

cclauss commented May 25, 2023

% chown --help
% chown -R richjagger /Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/node_modules

% chmod --help
% chmod -R +rw /Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/node_modules/.nodemon-xd0s1R7V/node_modules/fsevents/build

@richierockskool
Copy link
Author

richierockskool commented May 25, 2023 via email

@cclauss
Copy link
Contributor

cclauss commented May 25, 2023

% chown help
% sudo chown -R richjagger /Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/node_modules

% chmod help
% sudo chmod -R +rw /Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/node_modules/.nodemon-xd0s1R7V/node_modules/fsevents/build

@richierockskool
Copy link
Author

Still the same error loop

npm ERR! code EISDIR
npm ERR! syscall rename
npm ERR! path /Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway
npm ERR! dest /Users/richjagger/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w
npm ERR! errno -21
npm ERR! EISDIR: illegal operation on a directory, rename '/Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway' -> '/Users/richjagger/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w'

@cclauss
Copy link
Contributor

cclauss commented May 25, 2023

% npm doctor

@richierockskool
Copy link
Author

richierockskool commented May 25, 2023

Npm Doctor gives me this:

Check Value Recommendation/Notes
npm ping ok
npm -v not ok Use npm v9.6.7
node -v ok current: v18.16.0, recommended: v18.16.0
npm config get registry ok using default registry (https://registry.npmjs.org/)
git executable in PATH ok /usr/bin/git
global bin folder in PATH not ok Error: Add /Users/richjagger/.npm-packages/bin to your $PATH
Perms check on cached files ok
Perms check on local node_modules ok
Perms check on global node_modules ok
Perms check on local bin folder ok
Perms check on global bin folder ok
Verify cache contents ok verified 1394 tarballs
npm ERR! Some problems found. See above for recommendations.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/richjagger/.npm/_logs/2023-05-25T14_18_30_416Z-debug-0.log

Until I run
export PATH=~/.npm-packages/bin:$PATH

Then Npm Doctor gives me this:

Check Value Recommendation/Notes
npm ping ok
npm -v ok current: v9.6.7, latest: v9.6.7
node -v ok current: v18.16.0, recommended: v18.16.0
npm config get registry ok using default registry (https://registry.npmjs.org/)
git executable in PATH ok /usr/bin/git
global bin folder in PATH ok /Users/richjagger/.npm-packages/bin
Perms check on cached files ok
Perms check on local node_modules ok
Perms check on global node_modules ok
Perms check on local bin folder ok
Perms check on global bin folder ok
Verify cache contents ok verified 1394 tarballs

Then I run...

npm install -g homebridge-inkbird-wifi-gateway@1.0.9
npm ERR! code EISDIR
npm ERR! syscall rename
npm ERR! path /Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway
npm ERR! dest /Users/richjagger/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w
npm ERR! errno -21
npm ERR! EISDIR: illegal operation on a directory, rename '/Users/richjagger/.npm-packages/lib/node_modules/homebridge-inkbird-wifi-gateway' -> '/Users/richjagger/.npm-packages/lib/node_modules/.homebridge-inkbird-wifi-gateway-3htFxu5w'

@richierockskool
Copy link
Author

If I install with out " -g" I get this - no error , just Npm Warn which I have addressed and can not get rid of either,

npm install homebridge-inkbird-wifi-gateway@1.0.9
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated fsevents@1.2.13: The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies

@richierockskool
Copy link
Author

Go to https://chat.openai.com and ask these two questions:

  • On Windows, how can I set richjagger to be the owner of the directory /Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/node_modules and all files inside that directory?
  • On Windows, how can I set the directory /Users/richjagger/Documents/GitHub/homebridge-inkbird-wifi-gateway/node_modules/.nodemon-xd0s1R7V/node_modules/fsevents/build to be readable and writable?

Openai will not let me open an account?

@richierockskool
Copy link
Author

richierockskool commented Jun 6, 2023 via email

@cclauss
Copy link
Contributor

cclauss commented Jun 6, 2023

Let's continue this conversation at richierockskool/homebridge-inkbird-wifi-gateway#18

@cclauss cclauss closed this as completed Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants