Meteor NPM : Couldn't run `npm shrinkwrap`

204 views Asked by At

I've looked high and low for how to fix this, couldn't figure it out. Running a React - Meteor app, meteorhacks:npm and browserify.

Error:

While building package npm-container:
error: couldn't run `npm shrinkwrap`: Command failed: npm ERR! Error: Problems were encountered
npm ERR! Please correct and try again.
npm ERR! missing: react@^0.14.7, required by [email protected]
npm ERR! missing: react@^0.14.7, required by [email protected]
npm ERR! missing: react@^0.14.7, required by [email protected]
npm ERR! missing: react@^0.14.7, required by [email protected]
npm ERR!     at shrinkwrap_

Packages.json

{
    "externalify"           : "0.1.0",
    "react-tap-event-plugin": "0.2.2",
    "react-mixin"           : "3.0.3",
    "material-ui"           : "0.13.4",
    "formsy-react"          : "0.17.0",
    "formsy-material-ui"    : "0.3.3"
}

The strange thing though is I had this working, then once I tried updating from material-ui 0.13.4 to 0.14.4, the whole package stopped working. I then reverted back to 0.13.4 and the same error persisted. I've tried removing meteorhacks:npm and the npm-container folder, as well as clearing npm cache.

The error disappears if I downgrade material-ui to 0.13.1, though I'm still trying to fix as I need to upgrade to 0.14.

1

There are 1 answers

0
Victor.dMdB On

I finally solved it. The only way I found was to upgrade meteor to the 1.3 beta, which includes modules import, so I could remove npm-package.

There was a bit of refactoring, where you have to remove any packages which load react, import the relevant packages on every jsx file, and another small bug caused by material-ui (again) with npm (it loads react as well so you need to delete react folder from your_project/node_modules/material-ui/node_modules/react).