JamieMason / shrinkpack

Fast, resilient, reproducible builds with npm install.
https://www.npmjs.com/package/shrinkpack
MIT License
793 stars 38 forks source link

BUG: "TypeError: undefined is not a function" when running shrinkpack #73

Closed tadjohnston closed 8 years ago

tadjohnston commented 8 years ago
npm install --global shrinkpack
mkdir shrinkpack-demo
cd shrinkpack-demo
git init
echo node_modules >> .gitignore
echo npm-debug.log >> .gitignore
npm init --yes
echo save=true >> .npmrc
echo save-exact=true >> .npmrc
npm install async commander@2.7.1 express lodash request
echo cache=node_cache >> .npmrc
echo /node_cache >> .gitignore
tjohnston ~/source/shrinkpack-demo shrinkpack
! Please raise an issue at https://github.com/JamieMason/shrinkpack/issues

    TypeError: undefined is not a function
        at readNpmCache (/Users/tjohnston/.nvm/versions/node/v0.12.0/lib/node_modules/shrinkpack/src/analyse/read-npm-cache.js:16:17)
        at getConfigWithNpmCacheContents (/Users/tjohnston/.nvm/versions/node/v0.12.0/lib/node_modules/shrinkpack/src/analyse/index.js:61:12)
        at tryCatchReject (/Users/tjohnston/.nvm/versions/node/v0.12.0/lib/node_modules/shrinkpack/node_modules/when/lib/makePromise.js:845:30)
        at runContinuation1 (/Users/tjohnston/.nvm/versions/node/v0.12.0/lib/node_modules/shrinkpack/node_modules/when/lib/makePromise.js:804:4)
        at Fulfilled.when (/Users/tjohnston/.nvm/versions/node/v0.12.0/lib/node_modules/shrinkpack/node_modules/when/lib/makePromise.js:592:4)
        at Pending.run (/Users/tjohnston/.nvm/versions/node/v0.12.0/lib/node_modules/shrinkpack/node_modules/when/lib/makePromise.js:483:13)
        at Scheduler._drain (/Users/tjohnston/.nvm/versions/node/v0.12.0/lib/node_modules/shrinkpack/node_modules/when/lib/Scheduler.js:62:19)
        at Scheduler.drain (/Users/tjohnston/.nvm/versions/node/v0.12.0/lib/node_modules/shrinkpack/node_modules/when/lib/Scheduler.js:27:9)
        at process._tickCallback (node.js:355:11)
{
  "name": "shrinkpack-demo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "async": "2.0.1",
    "commander": "2.7.1",
    "express": "4.14.0",
    "lodash": "4.15.0",
    "request": "2.74.0"
  }
}
tjohnston ~/source/shrinkpack-demo npm version
{ 'shrinkpack-demo': '1.0.0',
  npm: '3.7.3',
  http_parser: '2.3',
  modules: '14',
  node: '0.12.0',
  openssl: '1.0.1l',
  uv: '1.0.2',
  v8: '3.28.73',
  zlib: '1.2.8' }
DrewML commented 8 years ago

Think this is the same root cause as https://github.com/JamieMason/shrinkpack/issues/71.

tadjohnston commented 8 years ago

@DrewML yeah I saw that. Wasn't sure, so I just posted since the actual errors were slightly different. We can close this if needed.

tjohnston ~/source/shrinkpack-demo npm config get cache
/Users/tjohnston/source/shrinkpack-demo/node_cache
tadjohnston commented 8 years ago

We can close this. Just tried this with node 5.8.0 and it seems to work fine. Issue here is with node 0.12.0.