Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'shrinkpack' of undefined #30

Closed
ryanxcharles opened this issue Apr 13, 2016 · 4 comments
Closed

Cannot read property 'shrinkpack' of undefined #30

ryanxcharles opened this issue Apr 13, 2016 · 4 comments

Comments

@ryanxcharles
Copy link

Just updated to the latest version of shrinkpack, and I get this error:

    TypeError: Cannot read property 'shrinkpack' of undefined
        at removeDep (/home/ryan/.nvm/versions/node/v4.3.1/lib/node_modules/shrinkpack/task/removeFromBundle.js:16:32)
        at Array.map (native)
        at Object.removeFromBundle (/home/ryan/.nvm/versions/node/v4.3.1/lib/node_modules/shrinkpack/task/removeFromBundle.js:12:27)
        at removeFromBundle (/home/ryan/.nvm/versions/node/v4.3.1/lib/node_modules/shrinkpack/index.js:48:15)
        at process._tickCallback (node.js:364:9)

Here is the full output from my terminal:

i 1332 dependencies in npm-shrinkwrap.json
i 10 have a missing "resolved" property
i 20 need removing from ./node_shrinkwrap
i 0 need adding to ./node_shrinkwrap
i 0 are in your npm cache
i 0 need downloading
✓ set missing "resolved" property for [email protected] to https://registry.npmjs.org/datt/-/datt-0.4.2.tgz
✓ set missing "resolved" property for [email protected] to https://registry.npmjs.org/fullnode/-/fullnode-0.13.13.tgz
✓ set missing "resolved" property for [email protected] to https://registry.npmjs.org/injecter/-/injecter-1.0.0.tgz
✓ set missing "resolved" property for [email protected] to https://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz
✓ set missing "resolved" property for [email protected] to https://registry.npmjs.org/fullnode/-/fullnode-0.13.13.tgz
✓ set missing "resolved" property for [email protected] to https://registry.npmjs.org/injecter/-/injecter-1.0.0.tgz
✓ set missing "resolved" property for [email protected] to https://registry.npmjs.org/injecter/-/injecter-1.0.0.tgz
✓ set missing "resolved" property for [email protected] to http://registry.npmjs.org/esprima-fb/-/esprima-fb-13001.1001.0-dev-harmony-fb.tgz
✓ set missing "resolved" property for [email protected] to http://registry.npmjs.org/esprima-fb/-/esprima-fb-13001.1001.0-dev-harmony-fb.tgz
? [email protected] has no "dist.tarball" in package.json, trying npm registry...
✓ set missing "resolved" property for [email protected] to https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.6.25.tgz
! Please raise an issue at https://github.com/JamieMason/shrinkpack/issues

    TypeError: Cannot read property 'shrinkpack' of undefined
        at removeDep (/home/ryan/.nvm/versions/node/v4.3.1/lib/node_modules/shrinkpack/task/removeFromBundle.js:16:32)
        at Array.map (native)
        at Object.removeFromBundle (/home/ryan/.nvm/versions/node/v4.3.1/lib/node_modules/shrinkpack/task/removeFromBundle.js:12:27)
        at removeFromBundle (/home/ryan/.nvm/versions/node/v4.3.1/lib/node_modules/shrinkpack/index.js:48:15)
        at process._tickCallback (node.js:364:9)
@JamieMason
Copy link
Owner

Thanks for this Ryan, could you post your package.json or npm-shrinkwrap.json please?

@JamieMason JamieMason added the bug label Apr 14, 2016
@jordalgo
Copy link

jordalgo commented Apr 14, 2016

I got this error too. I'm on node 0.12.7 and npm 2.15.3. Sorry but I can't post my package.json file.

! Please raise an issue at https://github.com/JamieMason/shrinkpack/issues

    TypeError: Cannot read property 'shrinkpack' of undefined
        at removeDep (/Users/jordalgo/.nvm/versions/node/v4.4.3/lib/node_modules/shrinkpack/task/removeFromBundle.js:16:32)
        at Array.map (native)
        at Object.removeFromBundle (/Users/jordalgo/.nvm/versions/node/v4.4.3/lib/node_modules/shrinkpack/task/removeFromBundle.js:12:27)
        at removeFromBundle (/Users/jordalgo/.nvm/versions/node/v4.4.3/lib/node_modules/shrinkpack/index.js:48:15)
        at process._tickCallback (node.js:369:9)
        at Function.Module.runMain (module.js:443:11)
        at startup (node.js:139:18)
        at node.js:968:3

@ryanxcharles
Copy link
Author

Today, I tried the same thing and it worked with no error. I will leave it up to you whether to close the issue though :) I think there is probably still a bug.

Here is my package.json (npm-shrinkwrap.json is too big to fit in a comment):

{
  "name": "yours",
  "private": true,
  "version": "0.2.0",
  "description": "Yours.",
  "main": "index.js",
  "scripts": {
    "build": "./node_modules/.bin/gulp",
    "build-testnet": "FULLNODE_NETWORK=testnet DATT_BLOCKCHAIN_API_URI=https://test-insight.bitpay.com/api/ ./node_modules/.bin/gulp",
    "build-yoursreact-testnet": "FULLNODE_NETWORK=testnet DATT_BLOCKCHAIN_API_URI=https://test-insight.bitpay.com/api/ ./node_modules/.bin/gulp build-yoursreact",
    "standard": "./node_modules/.bin/standard *.js lib/**/*.js bin/**/*.js server/**/*.js test/**/*.js test/**/*.jsx react/**/*.js react/**/*.jsx",
    "test-format": "npm run standard",
    "serve-testnet": "FULLNODE_NETWORK=testnet DATT_BLOCKCHAIN_API_URI=https://test-insight.bitpay.com/api/ gulp serve",
    "test-files": "./node_modules/.bin/mocha --compilers .jsx:babel-core/register --require=fullnode --require=datt --require=css-modules-require-hook/preset test/global.js",
    "test-node": "npm run test-files test/*.js test/*.jsx",
    "test": "npm run test-format && npm run test-node"
  },
  "engines": {
    "node": ">=4.3.0"
  },
  "browserify": {
    "transform": [
      [
        "babelify",
        {
          "presets": [
            "es2015",
            "react"
          ]
        }
      ]
    ]
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/dattnetwork/yours.git"
  },
  "contributors": [
    {
      "name": "Ryan X. Charles",
      "email": "[email protected]"
    },
    {
      "name": "Steven McKie",
      "email": "[email protected]"
    },
    {
      "name": "Anupam Mishra",
      "email": "[email protected]"
    }
  ],
  "author": "Ryan X. Charles <[email protected]>",
  "license": "UNLICENSED",
  "dependencies": {
    "asink": "1.0.4",
    "body-parser": "1.15.0",
    "css-modules-require-hook": "4.0.0",
    "css-modulesify": "0.22.0",
    "datt": "0.4.2",
    "express": "4.13.4",
    "fullnode": "0.13.13",
    "http-proxy": "1.13.2",
    "injecter": "1.0.0",
    "isomorphic-fetch": "2.2.1",
    "pouchdb": "5.3.1",
    "react": "15.0.1",
    "react-dom": "15.0.1",
    "react-router": "2.0.1",
    "should": "8.3.0",
    "sinon": "1.17.3"
  },
  "devDependencies": {
    "babel-core": "6.7.6",
    "babel-polyfill": "6.7.4",
    "babel-preset-es2015": "6.6.0",
    "babel-preset-react": "6.5.0",
    "babelify": "7.2.0",
    "bootstrap": "3.3.6",
    "browser-sync": "2.11.2",
    "browserify": "13.0.0",
    "envify": "3.4.0",
    "gulp": "3.9.1",
    "gulp-karma": "0.0.5",
    "gulp-mocha": "2.2.0",
    "gulp-plumber": "1.1.0",
    "gulp-util": "3.0.7",
    "gulp-watch": "4.3.5",
    "istanbul": "0.4.3",
    "jsdom": "8.3.0",
    "karma": "0.13.22",
    "karma-firefox-launcher": "0.1.7",
    "karma-mocha": "0.2.2",
    "mocha": "2.4.5",
    "reactify": "1.1.1",
    "standard": "6.0.8"
  }
}

@jordalgo
Copy link

To give a bit more context. I got this error when I tried to upgrade a package when I already had a shrinkpacked shrinkwrap file. I reproduced with these steps:

npm install --save-dev [email protected]
npm shrinkwrap --dev
shrinkpack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants