question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Broken npm ci since forks replaced official dependencies

See original GitHub issue

Hello,

It appears that recent changes in package.json have broken the npm ci with npm < v7.x

Probably due to changes to the lockfile.

Prior to npm 7 yarn.lock files were ignored

Source: https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/

Steps to reproduce the error with npm 6

cat '{
  "name": "test-project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "plotly.js": "^2.5.0"
  }
}' > package.json

npm install --package-lock-only
npm ci

npm ci exists with the following error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for zero-crossings@1.1.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aurelienbaumann/.npm/_logs/2021-09-07T20_14_08_058Z-debug.log

Looking in package-lock.json to see the details about zero-crossings, I can see the resolved field is ignored.

"zero-crossings": {
  "version": "1.1.0",
  "resolved": "git+https://github.com/plotly/zero-crossings.git#4746771f490344e21c84d1f631cb661d8c5ff508"
}

We should probably find a workaround this if we want to keep supporting npm < 7.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nicolaskruchtencommented, Sep 8, 2021

We’re looking into this! In general, we recommend that folks depend upon a prebuilt bundle like plotly.js-dist or create a custom bundle and include that in their source tree, rather than depending upon plotly.js directly. We’ll try to fix this, but we don’t rigorously test this case so we may break it again in the future.

0reactions
sepanscommented, Sep 29, 2021

We are having the same issue when trying to build the package on a build/ci machine that doesn’t have open access to the internet (e.g. github). I used plotly.js-dist and bundle customization referenced in https://github.com/plotly/react-plotly.js/pull/260 and now the builds are working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] npm ci can't resolve dependencies without --force, or ...
This is a breaking change without bumping major version. Any update on this issue? 28
Read more >
npm-ci
npm ci can only install entire projects at a time: individual dependencies cannot be added with this command. If a node_modules is already...
Read more >
npm ci can only install packages with an ... - Stack Overflow
After a lot of research, I was able to figure out that this happens when you are not using npm install for installing...
Read more >
npm packages in the Package Registry - GitLab Docs
Watch a video demo of how to publish npm packages to the GitLab Package Registry. ... Replace your_token with a deploy token, group...
Read more >
Javascript (Node.js) with Bitbucket Pipelines - Atlassian Support
This guide shows you how to use Bitbucket Pipelines for building and testing a Node.js software project in a Docker container.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found