Coder Social home page Coder Social logo

assets's Introduction

Stand With Ukraine

assets's People

Contributors

borodean avatar onigoetz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

assets's Issues

Cannot find module 'calipers-png' when using npm v5.2.0

Env:

  • node v8.1.4
  • npm v5.2.0

Errors:

Error: Cannot find module 'calipers-png'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at /Users/xxx/test/node_modules/calipers/lib/index.js:32:14
    at Array.map (native)
    at module.exports (/Users/xxx/test/node_modules/calipers/lib/index.js:28:22)
    at Object.<anonymous> (/Users/xxx/test/node_modules/assets/lib/size.js:1:97)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)

Reasons:
these code in the assets/lib/size.js caused the problems

var calipers = require('calipers')('webp', 'png', 'jpeg', 'gif', 'svg');

In the calipers

module.exports = function () {
  var args = Array.prototype.slice.call(arguments);

  var plugins = args.map(function (arg) {
    if (typeof arg === 'object') {
      return arg;
    } else {
      return require('calipers-' + arg);
    }
  });

  return {
    measure: measure.bind(null, plugins)
  };
};

But, the installed packages are the followwings:

$ ls node_modules/                                                    
assets           calipers         inflight         once
async            calipers-svg     inherits         path-is-absolute
balanced-match   calipers-webp    lodash           wrappy
bluebird         concat-map       mime
brace-expansion  glob             minimatch

And

$ ls node_modules/assets/node_modules/                                
calipers-gif  calipers-jpeg calipers-png

So. calipers in node_modules/ couldn't find calipers-png in node_modules/assets/node_modules/.

The solutions:

var webp = require('calipers-webp');
var png = require('calipers-png');
var jpeg = require('calipers-jpeg');
var gif = require('calipers-gif');
var svg = require('calipers-svg');
var calipers = require('calipers')(webp, png, jpeg, gif, svg);

Publish 2.1.1 to NPM?

Is there a chance of publishing 2.1.1 to NPM as it contains an update pointing to v4 of lodash?

no typescript supported

npm install @types/assets
npm ERR! code E404
npm ERR! 404 Not Found: @types/assets@latest

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2018-12-07T08_42_30_384Z-debug.log

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.