npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

NPM VS Yarn folder structure problems?

What I Wanted to Do

I wanted the folder structure to be such that I could require from a particular module and it would import the appropriate information.

What Happened Instead

The module imported was something other than what was intended.

The catch is that it all works perfectly after installing dependencies with Yarn.

Reproduction Steps

Follow instructions at this repo ->


While there are many complexities to this simple application, the fix is simple: use Yarn. However, there should not be a reason why it works with Yarn and not NPM. Therefore, it seems that this is an NPM bug.

Platform Info

macOS Version 10.14.2
node v11.9.0
Chrome Version 72.0.3626.81 (Official Build) (64-bit)

$ npm --versions
<!-- paste output here -->
{ 'xxxxxxxxxxxxxxx': '1.0.0',
  npm: '6.5.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  llhttp: '1.0.1',
  modules: '67',
  napi: '4',
  nghttp2: '1.34.0',
  node: '11.9.0',
  openssl: '1.1.1a',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.25.0',
  v8: '',
  zlib: '1.2.11' }
$ node -p process.platform
<!-- paste output here -->

I don’t believe this is a bug in npm, but a matter of which package either package manager happened to hoist – the fix in your case is just npm i jss@10.0.0-alpha.0, which will make the correct version of the package available to your app. worksforme now :slight_smile: