Git Product home page Git Product logo

Comments (6)

dsl101 avatar dsl101 commented on July 26, 2024 1

I'm still newish to npm, so maybe I'm doing it wrong. I just tried npm update to check for issues, and it returned nothing (usually a good sign). I then tried to install vue-async-computed and I get the dependency error. I'm not sure where to look. I've also put the whole package.json file below, and I can't see anything pinned to a specific version. Indeed, the error is now for [email protected], one point release higher...

[root@git: /vue/test] $ npm update
[root@git: /vue/test] $ npm i --save vue-async-computed
[email protected] /vue/test
├── UNMET PEER DEPENDENCY [email protected]
└── [email protected]

test app package.json:

{
  "name": "test",
  "version": "1.0.0",
  "description": "A Vue.js project",
  "author": "",
  "private": true,
  "scripts": {
    "dev": "node build/dev-server.js",
    "build": "node build/build.js",
    "lint": ""
  },
  "dependencies": {
    "vue": "^2.0.1"
  },
  "devDependencies": {
    "autoprefixer": "^6.4.0",
    "babel-core": "^6.0.0",
    "babel-loader": "^6.0.0",
    "babel-plugin-transform-runtime": "^6.0.0",
    "babel-preset-es2015": "^6.0.0",
    "babel-preset-stage-2": "^6.0.0",
    "babel-register": "^6.0.0",
    "chalk": "^1.1.3",
    "connect-history-api-fallback": "^1.1.0",
    "css-loader": "^0.25.0",
    "eventsource-polyfill": "^0.9.6",
    "express": "^4.13.3",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.9.0",
    "function-bind": "^1.0.2",
    "html-webpack-plugin": "^2.8.1",
    "http-proxy-middleware": "^0.17.2",
    "json-loader": "^0.5.4",
    "semver": "^5.3.0",
    "opn": "^4.0.2",
    "ora": "^0.3.0",
    "shelljs": "^0.7.4",
    "url-loader": "^0.5.7",
    "vue-loader": "^9.4.0",
    "vue-style-loader": "^1.0.0",
    "webpack": "^1.13.2",
    "webpack-dev-middleware": "^1.8.3",
    "webpack-hot-middleware": "^2.12.2",
    "webpack-merge": "^0.14.1"
  },
  "engines": {
    "node": ">= 4.0.0",
    "npm": ">= 3.0.0"
  }
}

from vue-async-computed.

dsl101 avatar dsl101 commented on July 26, 2024

I also tried the global script tag approach, but then I see this in the browser console:

Uncaught ReferenceError: exports is not defined
    at [email protected]:3

I am using Webpack / Babel, so perhaps this method of installing doesn't play nicely in that environment?

from vue-async-computed.

foxbenjaminfox avatar foxbenjaminfox commented on July 26, 2024

It is rather strange that it's giving you that error message, because vue-async-computed has a peer dependency on [email protected].

Are you sure that you don't accidentally have a dependency in some other package on [email protected]? Perhaps when installing [email protected] you changed the line for the vue package as well? This is unfounded speculation, because there vue-async-computed's package.json definitely targets [email protected].

As for the exports: I see there is a bit of a problem with the UMD packager, so the global script tag approach isn't working at the moment. I'll fix that and release a [email protected] with the fix. Thanks for catching that!

from vue-async-computed.

foxbenjaminfox avatar foxbenjaminfox commented on July 26, 2024

Interesting. In fact, there is a Vue 2.1.4, which was published yesterday. It seems that Vue 2.1.3 was indeed the latest version when you first tried.

I also now see the problem. NPM's error message in this case is rather confusing. What it's saying is that [email protected] doesn't fit vue-async-computed's peer dependency. This is because vue-async-computed's peer dependency is ~2.0.3, meaning 2.0.3 or later, but before 2.1.0.

In fact, that means the problem is the exact opposite of what you initially supposed: Rather than vue-async-computed requiring a too high a version of Vue, it requires a too old version.

I suppose that vue-async-computed could easily have a less strict peer dependency. A minor release of Vue is unlikely to break vue-async-computed. Given that, I've released [email protected] with a weaker peer dependency, which should solve your issue.

from vue-async-computed.

dsl101 avatar dsl101 commented on July 26, 2024

Well, yes I suppose it might be helpful if npm said exactly how the dependency wasn't met - then it might have been easier to untangle. Anyway, many thanks for fixing both ways of including v-a-c! npm install runs now without errors (I haven't checked the script tag method I'm afraid).

from vue-async-computed.

foxbenjaminfox avatar foxbenjaminfox commented on July 26, 2024

Yes, I also fixed the script tag method.

It's true that npm's error message in this case isn't so good. In general, peer dependencies in npm are rather a pain, in that sometimes it's hard to tell how to deal with or to satisfy them.

With [email protected]'s new (looser) peer dependency, this should hopefully not be an issue again.

from vue-async-computed.

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.