thlorenz / browserify-shim

📩 Makes CommonJS incompatible files browserifyable.
MIT License
933 stars 87 forks source link

Help with 'peer invalid' issue #196

Closed bodyslam closed 8 years ago

bodyslam commented 8 years ago

Heya! We had to update a our Browserify version from 3.x.x to 12.x.x along with swap and shim. I'm currently running into an install issue with the following:

npm ERR! peerinvalid The package browserify does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer browserify-shim@3.8.11 wants browserify@>= 2.3.0 < 13

npm ERR! System Darwin 14.5.0
npm ERR! command "/Users/twong1/.nvm/v0.10.33/bin/node" "/Users/twong1/.nvm/v0.10.33/bin/npm" "i"
npm ERR! cwd /Users/twong1/github/cnt-feature-homepage
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code EPEERINVALID
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/twong1/github/cnt-feature-homepage/npm-debug.log
npm ERR! not ok code 0
cnt-feature-homepage@0.8.3 /Users/twong1/github/cnt-feature-homepage
├─┬ appup@1.3.4
│ └── browserify@12.0.1 
├── browserify@12.0.1  peer invalid
└─┬ zuul@2.0.0
  ├── browserify@9.0.3 
  └─┬ watchify@2.3.0
    └── browserify@8.1.3 

npm ERR! peer invalid: browserify@12.0.1 /Users/twong1/github/cnt-feature-homepage/node_modules/browserify
npm ERR! not ok code 0

It appears to me that the browserify versions are within the shim's ranges. Any help would be greatly appreciated!

thlorenz commented 8 years ago

@bendrucker should be able to help you here.

bendrucker commented 8 years ago

Just updated the docs to clarify the required steps with npm@3. You'll need to npm install browserify browserify-shim.

bodyslam commented 8 years ago

Confirmed working after updating my npm to v3.3.12. Thanks guys!

Joseph7451797 commented 7 years ago

@bendrucker, I use npm@3 and encountered an error while using npm shrinkwrap --dev. Here is my output of npm ls:

├─┬ videojs-contrib-hls@3.6.10
│ ├─┬ aes-decrypter@1.0.3
│ │ └── pkcs7@0.2.3
│ ├── global@4.3.1
│ ├── m3u8-parser@1.2.0
│ ├─┬ mux.js@3.0.2
│ │ ├── UNMET PEER DEPENDENCY browserify@>= 2.3.0 < 14
│ │ └─┬ browserify-shim@3.8.12
│ │   ├─┬ exposify@0.4.3
│ │   │ ├─┬ globo@1.0.2
│ │   │ │ ├─┬ accessory@1.0.1
│ │   │ │ │ └── dot-parts@1.0.1
│ │   │ │ ├── is-defined@1.0.0
│ │   │ │ └── ternary@1.0.0
│ │   │ ├── has-require@1.1.0
│ │   │ ├─┬ replace-requires@1.0.3
│ │   │ │ ├─┬ detective@4.1.1
│ │   │ │ │ ├── acorn@1.2.2
│ │   │ │ │ ├── defined@1.0.0
│ │   │ │ │ └─┬ escodegen@1.8.1
│ │   │ │ │   ├── esprima@2.7.3
│ │   │ │ │   ├── estraverse@1.9.3
│ │   │ │ │   ├── esutils@2.0.2
│ │   │ │ │   └─┬ optionator@0.8.2
│ │   │ │ │     ├── deep-is@0.1.3
│ │   │ │ │     ├── fast-levenshtein@2.0.5
│ │   │ │ │     ├── levn@0.3.0
│ │   │ │ │     ├── prelude-ls@1.1.2
│ │   │ │ │     ├── type-check@0.3.2
│ │   │ │ │     └── wordwrap@1.0.0
│ │   │ │ ├── has-require@1.2.2
│ │   │ │ └── patch-text@1.0.2
│ │   │ ├─┬ through2@0.4.2
│ │   │ │ └─┬ xtend@2.1.2
│ │   │ │   └── object-keys@0.4.0
│ │   │ └─┬ transformify@0.1.2
│ │   │   └── readable-stream@1.1.14
│ │   ├─┬ mothership@0.2.0
│ │   │ └── find-parent-dir@0.3.0
│ │   ├─┬ rename-function-calls@0.1.1
│ │   │ └─┬ detective@3.1.0
│ │   │   ├─┬ escodegen@1.1.0
│ │   │   │ ├── esprima@1.0.4
│ │   │   │ ├── estraverse@1.5.1
│ │   │   │ ├── esutils@1.0.0
│ │   │   │ └── source-map@0.1.43
│ │   │   └── esprima-fb@3001.1.0-dev-harmony-fb
│ │   └── resolve@0.6.3
│ └─┬ videojs-contrib-media-sources@4.1.0
│   └── webworkify@1.0.2
...
npm ERR! peer dep missing: browserify@>= 2.3.0 < 14, required by browserify-shim@3.8.12

I know in npm@3, npm doesn't install peerdependencies, but npm shrinkwrap do read peerdependencies setting and return error. Here is my question: is it possible to add 'browserify' to 'dependencies'?