Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NPM dependencies fail to download in certain cases #1761

@rdickert

Description

@rdickert

Although it only affects outside packages (and therefore perhaps not officially supported), I thought I'd report it in case it affects the next iteration of the package system and Meteorite as we near 1.0 – and in any case, these packages are widely used and expected to work.

It turns that that outside package NPM dependencies may fail to download if the directory /node_modules is present in its parent directories. E.g., if my meteor project is in ~/sites/my_project, the presence of a directory ~/node_modules or ~/sites/node_modules will cause meteor add to fail in some cases.

To reproduce:

  • meteor create a bare project.
  • Add a packages directory and clone in the scss package git clone https://github.com/fourseven/meteor-scss.git.
  • Make sure you have a ~/node_modules directory (assuming your new project is somewhere under your home directory)
  • meteor add meteor-scss Fails.
  • if you remove ~/node_modules and repeat meteor add meteor-scss, it works. Once this process is done, you can put back ~/node_modules, and the project will continue to work, but new meteor adds will fail.

I'm attaching a stack trace below. It appears that perhaps a recursive process is glomming onto the wrong node_modules directory and finding it lacks the module and the also no shrinkwrap to download the package. Here's the link to where the trace fails in bundler.js. I don't know if there are other ways to trigger this bug, but there are some other issues I found that may be related posted here. This was done on Meteor 0.7.1 on OSX 10.9.1.

➜  xerr4  meteor add meteor-scss
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: debug@*, required by [email protected]
npm ERR! missing: minimatch@~0.2.11, required by [email protected]
npm ERR! missing: inherits@2, required by [email protected]
npm ERR! missing: wordwrap@~0.0.2, required by [email protected]
npm ERR! not ok code 0

=> Errors while scanning packages:

While building plugin `meteor-scss` in package `meteor-scss`:
error: couldn't read npm version lock information

While loading plugin `meteor-scss` from package `meteor-scss`:
module.js:338:15: Cannot find module 'node-sass'
  at Function.Module._resolveFilename (module.js:338:15)
  at Function.Module._load (module.js:280:25)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object._.extend.Npm.require (/Users/robert/.meteor/tools/09b63f1ed5/tools/bundler.js:999:22)
  at Package (packages/meteor-scss/plugin/compile-scss.js:2)
  at <runJavaScript-3>:59:4
  at <runJavaScript-3>:66:3

➜  xerr4
➜  xerr4  % Here I renamed  ~/node_modules
➜  xerr4
➜  xerr4  meteor add meteor-scss
meteor-scss: updating npm dependencies -- node-sass...
meteor-scss: Style with attitude.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions