Coder Social home page Coder Social logo

Bad "main" in package.json about flummox HOT 5 CLOSED

acdlite avatar acdlite commented on July 28, 2024
Bad "main" in package.json

from flummox.

Comments (5)

acdlite avatar acdlite commented on July 28, 2024

The lib directory is generated as part of the build task. https://github.com/acdlite/flummox/blob/master/CONTRIBUTING.md#file-organization

from flummox.

jarib avatar jarib commented on July 28, 2024

What mistake am I making here?

#!/bin/bash

set -e
set -x

cat <<END > package.json
{
  "name": "test",
  "version": "1.0.0",
  "dependencies": {
    "react": "^0.12.2",
    "babel-core": "^4.7.3",
    "babel-loader": "^4.1.0",
    "flummox": "^2.13.1",
    "webpack": "^1.7.2"
  }
}
END

cat <<END > webpack.config.js
module.exports = {
  entry: './index.js',

  resolve: { 
    extensions: ['', '.js']
  },

  module: {
      loaders: [
          { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel-loader?experimental'}
      ]
  }
};

END

cat <<END > index.js 
  import { React } from 'react';
  console.log(React);

  import { Flux } from 'flummox';
  console.log(Flux);
END


npm install
./node_modules/.bin/webpack --debug --display-error-details -c webpack.config.js
$ bash test.sh
+ cat
+ cat
+ cat
+ npm install
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No README data
+ ./node_modules/.bin/webpack --debug --display-error-details -c webpack.config.js
Hash: 8ead9f8c68e6485c1e3e
Version: webpack 1.7.2
Time: 993ms
            Asset    Size  Chunks             Chunk Names
webpack.config.js  589487       0  [emitted]  main
    + 148 hidden modules

ERROR in ./index.js
Module not found: Error: Cannot resolve module 'flummox' in /private/tmp/flummox-test
resolve module flummox in /private/tmp/flummox-test
  looking for modules in /private/tmp/flummox-test/node_modules
    resolve 'file' flummox in /private/tmp/flummox-test/node_modules
      resolve file
        /private/tmp/flummox-test/node_modules/flummox is not a file
        /private/tmp/flummox-test/node_modules/flummox.js doesn't exist
    resolve 'file' or 'directory' /private/tmp/flummox-test/node_modules/flummox
      resolve file
        /private/tmp/flummox-test/node_modules/flummox is not a file
        /private/tmp/flummox-test/node_modules/flummox.js doesn't exist
      resolve directory
        directory default file index
          resolve file index in /private/tmp/flummox-test/node_modules/flummox
            /private/tmp/flummox-test/node_modules/flummox/index doesn't exist
            /private/tmp/flummox-test/node_modules/flummox/index.js doesn't exist
        use lib/Flux.js from package.json
          resolve 'file' or 'directory' lib/Flux.js in /private/tmp/flummox-test/node_modules/flummox
            resolve file
              /private/tmp/flummox-test/node_modules/flummox/lib/Flux.js doesn't exist
              /private/tmp/flummox-test/node_modules/flummox/lib/Flux.js.js doesn't exist
            resolve directory
              /private/tmp/flummox-test/node_modules/flummox/lib/Flux.js doesn't exist (directory default file)
              /private/tmp/flummox-test/node_modules/flummox/lib/Flux.js/package.json doesn't exist (directory description file)
[/private/tmp/flummox-test/node_modules/flummox.js]
[/private/tmp/flummox-test/node_modules/flummox.js]
[/private/tmp/flummox-test/node_modules/flummox/index]
[/private/tmp/flummox-test/node_modules/flummox/index.js]
[/private/tmp/flummox-test/node_modules/flummox/lib/Flux.js]
[/private/tmp/flummox-test/node_modules/flummox/lib/Flux.js.js]
 @ ./index.js 7:11-29

from flummox.

acdlite avatar acdlite commented on July 28, 2024

Huh, I'm not sure. Just tried a fresh npm install in a new directory and it loaded fine. Does /private/tmp/flummox-test/node_modules/flummox/lib/Flux.js exist on your filesystem?

from flummox.

jarib avatar jarib commented on July 28, 2024

I think this was caused by an earlier attempt to use this repo as a package directly ("flummox": "acdlite/flummox" in package.json). After rm -rf ~/.npm/flummox + a fresh install things seems to be working.

from flummox.

acdlite avatar acdlite commented on July 28, 2024

Ah I see. I've had similar things happen to me before. I really wish npm would run npm prepublish on repo packages.

from flummox.

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.