Coder Social home page Coder Social logo

Comments (7)

mlabrum avatar mlabrum commented on September 24, 2024

It looks like the package.json file is being copied across and the relative path is fixed there, but the package-lock.json gets copied across with the releative path, and doesn't get fixed

from patch-package.

ds300 avatar ds300 commented on September 24, 2024

That makes sense. Thanks for the report, I'll fix it tonight.

from patch-package.

ds300 avatar ds300 commented on September 24, 2024

@mlabrum looks like you're running windows? This issue doesn't seem to happen on macOS - I have a potential fix for it but don't have easy access to a windows machine to test. Will have to wait until tomorrow afternoon probably.

from patch-package.

ds300 avatar ds300 commented on September 24, 2024

@mlabrum Found a windows laptop to test on, but still can't reproduce the issue. Do you mind testing whether the issue is fixed if you add patch-package to your project with this version string: git+https://github.com/ds300/patch-package#43a32991331eaec7017fd6c82fda64d7e4ea6a8e

If not, what version of npm are you using? Are you running patch-package from git bash or some other way?

from patch-package.

ds300 avatar ds300 commented on September 24, 2024

I still haven't been able to reproduce this issue, and there have been a lot of windows-related fixes since this issue appeared, so I'm going to close it due to inactivity. Feel free to reopen if you find you're still encountering the issue.

from patch-package.

Vi-dot avatar Vi-dot commented on September 24, 2024

Hello,

I also have this issue, on Ubuntu.

npm ERR! code ENOLOCAL
npm ERR! Could not install from "ext/ng2-pdf-viewer" as it does not contain a package.json file.

I edited a file inside project/node_modules/pdfjs-dist.
Then I launched npx patch-package pdfjs-dist.

Here is the project/package.json

  "dependencies": {
    "ng2-pdf-viewer": "./ext/ng2-pdf-viewer",
    "pdfjs-dist": "^1.9.602"
    [...]
  },
  "devDependencies": {
    "patch-package": "3.5.0"
    [...]
  }

Here is the project/ext/ng2-pdf-viewer/package.json

  "peerDependencies": {
    "pdfjs-dist": "^1.9.602"
  },
  "dependencies": {
    "pdfjs-dist": "^1.9.602"
  },
  "devDependencies": {
    [...]
  }

Same bug, with or without peerDependency.

Thanks

from patch-package.

ds300 avatar ds300 commented on September 24, 2024

Hi @Vi-dot

You should use the file: prefix for local dependencies. so "ng2-pdf-viewer": "./ext/ng2-pdf-viewer", becomes "ng2-pdf-viewer": "file:./ext/ng2-pdf-viewer",

It's not clear to me whether relative paths without a file: prefix are valid in a package.json dependency string. I could add support for them anyway, since they do seem to be supported unofficially at least.

from patch-package.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.