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

Fix:(Bug): GitHub Workflow Fails to Publish to NPM #138

Closed
wesdevpro opened this issue Oct 2, 2023 · 7 comments · Fixed by #135, #139 or #145
Closed

Fix:(Bug): GitHub Workflow Fails to Publish to NPM #138

wesdevpro opened this issue Oct 2, 2023 · 7 comments · Fixed by #135, #139 or #145
Assignees
Labels
bug Something isn't working

Comments

@wesdevpro
Copy link
Member

  • The npm ci command fails with the following errors:
Run npm ci
npm ERR! code EUSAGE
npm ERR! 
npm ERR! The `npm ci` command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR! 
npm ERR! Clean install a project
npm ERR! 
npm ERR! Usage:
npm ERR! npm ci
npm ERR! 
npm ERR! Options:
npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
npm ERR! [-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
npm ERR! [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm ERR! 
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR! 
npm ERR! Run "npm help ci" for more info

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2023-10-02T1[8](https://github.com/buefy/nuxt-buefy/actions/runs/6383928923/job/17325533242#step:4:9)_18_3[9](https://github.com/buefy/nuxt-buefy/actions/runs/6383928923/job/17325533242#step:4:10)_[13](https://github.com/buefy/nuxt-buefy/actions/runs/6383928923/job/17325533242#step:4:14)6Z-debug-0.log
Error: Process completed with exit code 1.
@wesdevpro wesdevpro linked a pull request Oct 2, 2023 that will close this issue
@wesdevpro wesdevpro self-assigned this Oct 2, 2023
@wesdevpro wesdevpro added the bug Something isn't working label Oct 2, 2023
@wesdevpro
Copy link
Member Author

wesdevpro commented Oct 2, 2023

Solution: run npm install to install all the required dependencies.
Source: https://stackoverflow.com/questions/69984660/npm-ci-can-only-install-packages-with-an-existing-package-lock-json-or-npm-shrin

Problem Number 2

Multiple Dependency issues were found when running npm install on my local machine.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: nuxt-buefy@0.4.26
npm ERR! Found: eslint@5.16.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^5.5.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^3.19.0" from eslint-config-buefy@0.0.2
npm ERR! node_modules/eslint-config-buefy
npm ERR!   dev eslint-config-buefy@"^0.0.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

What are your thoughts @gmercey, and @kikuomax.

@wesdevpro
Copy link
Member Author

wesdevpro commented Oct 2, 2023

Solution: run npm install to install all the required dependencies. Source: https://stackoverflow.com/questions/69984660/npm-ci-can-only-install-packages-with-an-existing-package-lock-json-or-npm-shrin

Problem Number 2

Multiple Dependency issues were found when running npm install on my local machine.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: nuxt-buefy@0.4.26
npm ERR! Found: eslint@5.16.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^5.5.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^3.19.0" from eslint-config-buefy@0.0.2
npm ERR! node_modules/eslint-config-buefy
npm ERR!   dev eslint-config-buefy@"^0.0.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

What are your thoughts @gmercey, and @kikuomax.

Note that there is a dependency eslint-config-buefy that has a newer version v0.0.3

image
Note that this dependency is failing.

On line 32 of that projects package.json file the following dependency eslint^v4.18.2 is required as a peer dependency. However, in our own dependencies listed in the nuxt-buefy the dependency eslint^5.5.0 is listed as a DevDepednecy. Is it possible that these two dependencies are conflicting each other?

@wesdevpro
Copy link
Member Author

image

@wesdevpro
Copy link
Member Author

wesdevpro commented Oct 2, 2023

Looking at Buefy/Buefy's package.json you will see that the devDependency for eslint is v4.18.2 After seeing this information I chose to test if rolling back eslint in nuxt-buefy would at least fix the issue. The rollback did fix the issue. However, we may want to consider updating these repositories (i.e nuxt-buefy, eslint-config-buefy, etc.) as eslint is already up to 8.50.0 However we may be restricted to a specific version of eslint depending on what nuxt v2 allows. @kikuomax @gmercey

@wesdevpro wesdevpro linked a pull request Oct 2, 2023 that will close this issue
@wesdevpro
Copy link
Member Author

wesdevpro commented Oct 2, 2023

Doing this just uncovered another error upon building and testing with Circle Ci

@gmercey @kikuomax please see #139 (comment)

@wesdevpro
Copy link
Member Author

wesdevpro commented Oct 3, 2023

A similar bug was just found @kikuomax 😢

Run npm ci
npm ERR! code EUSAGE
npm ERR! 
npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR! 
npm ERR! Invalid: lock file's buffer@4.9.2 does not satisfy buffer@6.0.3
npm ERR! Missing: buffer@4.9.2 from lock file
npm ERR! 
npm ERR! Clean install a project
npm ERR! 
npm ERR! Usage:
npm ERR! npm ci
npm ERR! 
npm ERR! Options:
npm ERR! [-S|--save|--no-save|--save-prod|--save-dev|--save-optional|--save-peer|--save-bundle]
npm ERR! [-E|--save-exact] [-g|--global] [--global-style] [--legacy-bundling]
npm ERR! [--omit <dev|optional|peer> [--omit <dev|optional|peer> ...]]
npm ERR! [--strict-peer-deps] [--no-package-lock] [--foreground-scripts]
npm ERR! [--ignore-scripts] [--no-audit] [--no-bin-links] [--no-fund] [--dry-run]
npm ERR! [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]]
npm ERR! [-ws|--workspaces] [--include-workspace-root] [--install-links]
npm ERR! 
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR! 
npm ERR! Run "npm help ci" for more info

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/[20](https://github.com/buefy/nuxt-buefy/actions/runs/6388687155/job/17338925831#step:4:21)[23](https://github.com/buefy/nuxt-buefy/actions/runs/6388687155/job/17338925831#step:4:24)-10-03T04_[30](https://github.com/buefy/nuxt-buefy/actions/runs/6388687155/job/17338925831#step:4:31)_55_798Z-debug-0.log
Error: Process completed with exit code 1.

@wesdevpro
Copy link
Member Author

This issue was fixed by simply regenerating the package-lock.json file ✨

@wesdevpro wesdevpro linked a pull request Oct 3, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Completed ✅
2 participants