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

Can't install / update #73

Closed
4 of 5 tasks
anotherglitchinthematrix opened this issue Sep 4, 2023 · 31 comments
Closed
4 of 5 tasks

Can't install / update #73

anotherglitchinthematrix opened this issue Sep 4, 2023 · 31 comments

Comments

@anotherglitchinthematrix
Copy link
Contributor

anotherglitchinthematrix commented Sep 4, 2023

Before you start, please make sure to:

  • Read the doc
  • Have tried the latest version
  • Search to see if your issue already exists
  • Look for / ask questions on Stack Overflow
  • Reproduce the bug in incognito/private mode to avoid interference from browser extensions

Link to minimal reproduction

Environment specific error

Steps to reproduce

  1. Linux: npm install json-editor-vue or npm update

  2. MacOS: npm update

What is expected?

Successfully update/install.

What is actually happening?

On linux;

npm ERR! code 127
npm ERR! path /home/.../workspace/test/node_modules/json-editor-vue
npm ERR! command failed
npm ERR! command sh -c simple-git-hooks
npm ERR! sh: line 1: simple-git-hooks: command not found

On MacOS;

I can't get the error message for now but the error was something like lstat couldn't be located.

System Info

System:
    OS: Linux 6.4 Arch Linux
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700H
    Memory: 12.55 GB / 15.31 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.5.1 - /usr/bin/node
    npm: 9.8.1 - /usr/bin/npm

Package Manager

npm

Any additional comments?

The problem occured on 10.0.7, 10.0.6 was working.

No response

@cloydlau
Copy link
Owner

cloydlau commented Sep 4, 2023

Can't reproduce. Provide a minimal reproduction.

@anotherglitchinthematrix
Copy link
Contributor Author

This seems environment specific, so even if I provide a reproduction I think it's impossible to reproduce on your side; on my side it's happening on new npm project aswell;

  1. npm init
  2. npm install json-editor-vue
  3. fail

I also tested with pnpm, but no luck.

image

image

@jennysol
Copy link

jennysol commented Sep 4, 2023

Same error here using Linux

@anotherglitchinthematrix
Copy link
Contributor Author

macOS error
Screenshot 2023-09-05 at 00 20 20
Screenshot 2023-09-05 at 00 21 01

@cloydlau
Copy link
Owner

cloydlau commented Sep 5, 2023

It seems a problem with 'postinstall' hook, try v0.10.8 @anotherglitchinthematrix @jennysol

@anotherglitchinthematrix
Copy link
Contributor Author

it seems it failed to publish

@cloydlau
Copy link
Owner

cloydlau commented Sep 5, 2023

image

Do you try it?

@anotherglitchinthematrix
Copy link
Contributor Author

Yes, but no luck, interesting

image

@cloydlau
Copy link
Owner

cloydlau commented Sep 5, 2023

image

Why is [email protected] not found?
Are you using some npm registry or VPN?

@cloydlau
Copy link
Owner

cloydlau commented Sep 5, 2023

I tried 0.10.8 with https://codesandbox.io, still ok.

@anotherglitchinthematrix
Copy link
Contributor Author

anotherglitchinthematrix commented Sep 5, 2023

This succeeded, and I don't have a problem with using it like that but still I don't understand why npm couldn't install transitive dependencies, I can close the issue if you can confirm this is ok.

image

@cloydlau
Copy link
Owner

cloydlau commented Sep 5, 2023

simple-git-hooks is a devDependency of json-editor-vue.
You can try npm@lts (10.0.0) & pnpm@lts (8.7.1) under node@lts (18.17.1) to see what's the result.

@lilis7575
Copy link

It seems that there is a problem with dependency in version 0.10.8.
If you define the version with ^ or ~, such as "json-editor-vue": "^0.10.6" in package.json, it will be set to version 0.10.6, such as "json-editor-vue": "0.10.6", Force it to be used.

Until the problem is fixed

@liangyouzhu
Copy link

liangyouzhu commented Sep 5, 2023

Same error here using jenkins
on window
image

@cloydlau
Copy link
Owner

cloydlau commented Sep 5, 2023

@lilis7575 @liangyouzhu Hey, what if you manually install 'simple-git-hooks' in advance?
Is this problem related to toplenboren/simple-git-hooks#82 or toplenboren/simple-git-hooks#69?

@liangyouzhu
Copy link

I have already resolved this issue, it is a dependency issue. Thank you @cloydlau

@cloydlau
Copy link
Owner

cloydlau commented Sep 6, 2023

@liangyouzhu Could you tell me how?

@cloydlau
Copy link
Owner

cloydlau commented Sep 6, 2023

@anotherglitchinthematrix @lilis7575 @jennysol @liangyouzhu I believe v0.10.10 solved this problem. Oddly enough both vite & vue don't have this problem while putting simple-git-hooks in devDependencies.

@cloydlau cloydlau closed this as completed Sep 6, 2023
@lilis7575
Copy link

You can solve the install problem by installing simple-git-hooks.
However, if you use VSCode, an error will occur when using the built-in git commit process.
simple-git-hooks appears to require some additional work for the hook when git commit, and additional settings must be made to bypass or disable it.
It is inefficient to make additional settings to simply use json-editor.

I am rooting for the developer as it is said to have been resolved in version 0.10.10.

@sleicht
Copy link

sleicht commented Sep 6, 2023

The problem is now, that simple-git-hooks adds hooks into the git repositories using json-editor-vue. In most of the cases that it not wished for and can lead to errors when calling git commit (i.e. ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Cannot read properties of undefined). Please remove this from the dependencies.

@lilis7575
Copy link

The problem is now, that simple-git-hooks adds hooks into the git repositories using json-editor-vue. In most of the cases that it not wished for and can lead to errors when calling git commit (i.e. ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL  Cannot read properties of undefined). Please remove this from the dependencies.

========================
you're right.
This is the problem caused by simple-git-hooks.

We don't want to use simple-git-hooks to use json-editor-vue.

Please remove it from dependencies.

@cloydlau
Copy link
Owner

cloydlau commented Sep 6, 2023

That make sense. But it's unable to install if I put simple-git-hooks into devDependencies. And it's hard for me to debug this issue without publishing multiple new versions. Use v0.10.6 for now, I will look into this. Any help will be appreciated.

@cloydlau cloydlau reopened this Sep 6, 2023
@lilis7575
Copy link

@cloydlau thank you

Why use simple-git-hooks?
If it is simply for lintering during pre-commit, it seems to be of no use when working alone.
Also, I think it is best not to use simple-git-hooks since it may require settings for each individual local environment.

You may agree to publish a new version for testing.

@cloydlau cloydlau reopened this Sep 6, 2023
@cloydlau
Copy link
Owner

cloydlau commented Sep 6, 2023

@anotherglitchinthematrix @sleicht @lilis7575 @jennysol @liangyouzhu
Hey guys, just released v0.10.14, help me test it in different operating system, thanks!

@sleicht
Copy link

sleicht commented Sep 6, 2023

@cloydlau Thanks, tried it and the issue with simple-git-hooks is resolved. But with my system I still have the issue, that it wants to do something in a lib directory, which fails:

[INFO] npm ERR! code 254
[INFO] npm ERR! path <PROJECT_DIR>/src/admin/node_modules/json-editor-vue
[INFO] npm ERR! command failed
[INFO] npm ERR! command sh -c npx only-allow pnpm
[INFO] npm ERR! npm ERR! code ENOENT
[INFO] npm ERR! npm ERR! syscall lstat
[INFO] npm ERR! npm ERR! path <PROJECT_DIR>/target/lib
[INFO] npm ERR! npm ERR! errno -2
[INFO] npm ERR! npm ERR! enoent ENOENT: no such file or directory, lstat '<PROJECT_DIR>/target/lib'
[INFO] npm ERR! npm ERR! enoent This is related to npm not being able to find a file.
[INFO] npm ERR! npm ERR! enoent 
[INFO] npm ERR! 

This issue I can work around with following maven plugin:


            <plugin>
                <!-- workaround for npm install issue with json-editor-vue -->
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <configuration>
                            <target>
                                <mkdir dir="target/lib" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

@cloydlau
Copy link
Owner

cloydlau commented Sep 7, 2023

@sleicht Hi, v0.10.15 won't run preinstall or postinstall hook when you install json-editor-vue as a dependency, give it a try.

@liangyouzhu
Copy link

My solution is to write the dependent versions of the package.json and lock files to death, so that errors will not be reported during compilation and packaging

@cloydlau
Copy link
Owner

cloydlau commented Sep 7, 2023

Anyone else? I wonder if v0.10.15 addresses this issue.

@lilis7575
Copy link

@cloydlau
I tested with version v0.10.15 and all the problems I faced were resolved.

thank you for your work

@sleicht
Copy link

sleicht commented Sep 7, 2023

@cloydlau I tested v0.10.15 as well and do not need any workaround anymore.
Thank you very much.

@cloydlau
Copy link
Owner

cloydlau commented Sep 7, 2023

You're welcome, you can hit the star to support my work, thanks.

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

6 participants