peerDependencies getting installed in to node_modules/node_modules

Issue #33 new
Chris Darroch created an issue

Here's the environment (running npm version):

build   27-Jul-2015 23:43:37    { npm: '2.6.1',
build   27-Jul-2015 23:43:37      http_parser: '2.3',
build   27-Jul-2015 23:43:37      modules: '14',
build   27-Jul-2015 23:43:37      node: '0.12.0',
build   27-Jul-2015 23:43:37      openssl: '1.0.1l',
build   27-Jul-2015 23:43:37      uv: '1.0.2',
build   27-Jul-2015 23:43:37      v8: '3.28.73',
build   27-Jul-2015 23:43:37      zlib: '1.2.8' }

Bamboo version 5.10.0-m17 build 51004.

I have a package.json file that looks like the following:

{
  "name": "@a/project",
  "devDependencies": {
    "@a/dependency": "*"
  },
  "private": true
}

The @a/dependency package has the following in it:

{
  "name": "@a/dependency",
  "version": "0.0.2",
  "main": "index.js",
  "scripts": {
    "test": ""
  },
  "peerDependencies": {
    "eslint": ">=0.21.0",
    "@a/nested-dependency": "0.1.2"
  },
  "license": "MIT"
}

My build runs an NPM command: npm install. Pretty standard.

Here's the output of that command:

npm WARN peerDependencies The peer dependency eslint@>=0.21.0 included from @a/dependency will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency @a/nested-dependency@0.1.2 included from @a/dependency will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.

@a/nested-dependency@0.1.2 node_modules/node_modules/@a/nested-dependency
└── strip-json-comments@1.0.2

eslint@0.24.1 node_modules/node_modules/eslint
├── escape-string-regexp@1.0.3
├── object-assign@2.1.1
├── path-is-absolute@1.0.0
├── strip-json-comments@1.0.2
├── xml-escape@1.0.0
├── user-home@1.1.1
├── estraverse-fb@1.3.1
├── globals@8.2.0
├── estraverse@4.1.0
├── text-table@0.2.0
├── debug@2.2.0 (ms@0.7.1)
├── chalk@1.1.0 (supports-color@2.0.0, ansi-styles@2.1.0, has-ansi@2.0.0, strip-ansi@3.0.0)
├── optionator@0.5.0 (type-check@0.3.1, deep-is@0.1.3, levn@0.2.5, wordwrap@0.0.3, prelude-ls@1.1.2, fast-levenshtein@1.0.6)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── minimatch@2.0.10 (brace-expansion@1.1.0)
├── concat-stream@1.5.0 (inherits@2.0.1, typedarray@0.0.6, readable-stream@2.0.2)
├── espree@2.2.3
├── is-my-json-valid@2.12.1 (jsonpointer@1.1.0, generate-function@2.0.0, xtend@4.0.0, generate-object-property@1.2.0)
├── doctrine@0.6.4 (isarray@0.0.1, esutils@1.1.6)
├── js-yaml@3.3.1 (esprima@2.2.0, argparse@1.0.2)
├── escope@3.2.0 (esrecurse@3.1.1, estraverse@3.1.0, es6-weak-map@0.1.4, es6-map@0.1.1)
└── inquirer@0.8.5 (figures@1.3.5, ansi-regex@1.1.1, cli-width@1.0.1, through@2.3.8, readline2@0.1.1, lodash@3.10.0, rx@2.5.3)

@a/dependency@0.0.2 node_modules/@a/dependency

Notice the nested node_modules/node_modules folder. I have no idea why that nested node module folder is being created. The modules should get installed in to the root node_modules directory.

I have resorted to adding this as a post-script:

if [ -d node_modules/node_modules ]; then
    rsync -v -r --links ./node_modules/node_modules/* ./node_modules
fi

Comments (1)

  1. Marcin Oles

    Hi @chrisdarroch,

    can you try to reproduce this problem without Bamboo, e.g. by just using "npm install" command in shell? Or using "node <pathToNpm> install" - which is the way the newest version of the plugin works? If the problem occurs, this might be an issue with npm tool, not Bamboo Node.js Plugin.

    Also, are there actually slashes used in package names, or was it just the way you've stripped the names? If so, could this be causing the issue?

  2. Log in to comment