vscode-npm-scripts: False positives reported when using yarn instead of npm to install modules

From @tyrsius on March 1, 2017 23:19

  • VSCode Version: Version 1.10.0 (1.10.0)
  • OS Version: macOS Sierre 10.12 (16A323)

Steps to Reproduce:

  1. Create an empty project with the following package.json file
{
  "name": "vscode-bug",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "dependencies": {
    "engine-handlebars": "^0.8.0",
    "express": "^4.14.0",
    "newrelic": "^1.36.2",
    "node-uuid": "^1.4.7"
  },
  "devDependencies": {
    "autoprefixer-stylus": "^0.11.0",
    "babel-core": "^6.3.21",
    "babel-eslint": "^7.0.0",
    "babel-loader": "^6.2.0",
    "babel-plugin-transform-runtime": "^6.15.0",
    "babel-plugin-webpack-alias": "^2.1.1",
    "babel-preset-es2015": "^6.3.13",
    "babel-preset-react": "^6.3.13",
    "babel-preset-stage-0": "^6.3.13",
    "babel-tape-runner": "^2.0.1",
    "blue-tape": "^1.0.0",
    "chokidar-cli": "^1.2.0",
    "deep-extend": "^0.4.1",
    "immutable": "^3.8.1",
    "json-loader": "^0.5.4",
    "localforage": "^1.4.3",
    "npm-run-all": "^4.0.1",
    "qs": "^6.3.0",
    "raw-loader": "^0.5.1",
    "react": "^15.3.2",
    "react-addons-test-utils": "^15.3.2",
    "react-document-title": "^2.0.2",
    "react-dom": "^15.3.2",
    "react-hot-loader": "^3.0.0-beta.6",
    "react-markdown": "^2.4.2",
    "react-redux": "^4.4.5",
    "react-router": "^2.8.1",
    "react-router-redux": "^4.0.6",
    "redbox-react": "^1.3.2",
    "redux": "^3.6.0",
    "redux-thunk": "^2.1.0",
    "skin-deep": "^0.16.0",
    "snazzy": "^5.0.0",
    "source-map-loader": "^0.1.5",
    "standard": "^8.4.0",
    "stylus": "^0.54.5",
    "tap-spec": "^4.1.1",
    "url-join": "^1.1.0",
    "webpack": "^1.11.0",
    "webpack-dev-server": "^1.10.1"
  },
  "author": "",
  "license": "ISC"
}
  1. run npm install
  2. You will see the following problems listed for dependencies

[npm] Module ‘https-proxy-agent’ is extraneous [npm] Module ‘node-pre-gyp’ is extraneous [npm] Module ‘readable-stream’ is extraneous

These packages are not dependencies of the package, and this error should not show.

Copied from original issue: Microsoft/vscode#21666

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 26 (17 by maintainers)

Commits related to this issue

Most upvoted comments

@banyudu

cnpm has this issue, too. But it doesn’t have a file like yarn.lock.

Thinking about this some more this extension should support that the user can configure which node package manager they want to use.

From @banyudu on March 29, 2017 1:44

@egamma Yes, it works with npm. But if someone use yarn or cnpm instead of npm, things are different.

npm install --save-dev eslint should create only one directory named ‘eslint’ under node_modules, while yarn add eslint and cnpm install --save-dev eslint will create lots of directories(or symbolic links) under node_modules.

These directories(or symbolic links) will trigger the extraneous warn.