How to install necessary packages by `npm install` - npm

I have the following in package.json.
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^4.0.0",
"bootstrap-sass": "^3.0.0"
}
}
After running npm install when I check node_modules, there are a lot of packages are installed. from .bin, abbrev to yeast. I think there are more than 200 packages. I thought npm installs only necessary packages including dependencies.
Q1: How can I avoid installing unnecessary packages and installing only necessary packages. Can I do it? Or do I need all packages?
Q2: Does npm install all npm packages?

Summary:
Q1: How can I avoid installing unnecessary packages and installing
only necessary packages. Can I do it? Or do I need all packages?
You are installing all dependencies required by the dependencies of your module (modules requiring modules).
Q2: Does npm install all npm packages?
No.
In depth:
You installed gulp. Here are gulp's dependencies:
"dependencies": {
"archy": "^1.0.0",
"chalk": "^1.0.0",
"deprecated": "^0.0.1",
"gulp-util": "^3.0.0",
"interpret": "^1.0.0",
"liftoff": "^2.1.0",
"minimist": "^1.1.0",
"orchestrator": "^0.3.0",
"pretty-hrtime": "^1.0.0",
"semver": "^4.1.0",
"tildify": "^1.0.0",
"v8flags": "^2.0.2",
"vinyl-fs": "^0.3.0"
}
archy has the following dependencies:
"dependencies": {
"ansi-styles": "^2.1.0",
"escape-string-regexp": "^1.0.2",
"supports-color": "^3.1.2"
},
interpret (still going through gulp dependencies) has the following dependencies:
"dependencies": {
"extend": "^2.0.1",
"findup-sync": "^0.3.0",
"flagged-respawn": "^0.3.1",
"rechoir": "^0.6.0",
"resolve": "^1.1.6"
}
liftoff has the following dependencies:
"dependencies": {
"extend": "^2.0.1",
"findup-sync": "^0.3.0",
"flagged-respawn": "^0.3.1",
"rechoir": "^0.6.0",
"resolve": "^1.1.6"
}
orchestrator requires the following dependencies:
"dependencies": {
"end-of-stream": "~0.1.5",
"sequencify": "~0.0.7",
"stream-consume": "~0.1.0"
},
...
In short... The bigger, more dependent module you install, the more dependencies are required. It's not always a bad thing. I recommend installing only what is needed to get the job you need done (sometimes it's a lot, sometimes not).
UPDATE
I just noticed that gulp was a dev-dependency... Moving on to elixir non-dev dependencies:
"dependencies": {
"babelify": "^7.2.0",
"browser-sync": "^2.7.10",
"browserify": "^11.2.0",
"del": "^1.2.0",
"glob": "^5.0.14",
"gulp-autoprefixer": "^2.3.1",
"gulp-babel": "^6.1.0",
"babel-preset-es2015": "^6.1.0",
"babel-preset-react": "^6.1.18",
"gulp-batch": "^1.0.5",
"gulp-coffee": "^2.3.1",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.0.0",
"gulp-if": "^1.2.5",
"gulp-less": "^3.0.3",
"gulp-load-plugins": "^1.0.0-rc.1",
"gulp-notify": "^2.2.0",
"gulp-phpspec": "^0.5.3",
"gulp-phpunit": "0.11.x",
"gulp-rename": "^1.2.2",
"gulp-rev": "^5.1.0",
"gulp-rev-replace": "^0.4.2",
"gulp-sass": "^2.0.3",
"gulp-sourcemaps": "^1.5.2",
"gulp-shell": "^0.5.0",
"gulp-uglify": "^1.4.2",
"gulp-util": "^3.0.6",
"gulp-watch": "^4.2.4",
"insert-css": "^0.2.0",
"merge-stream": "^0.1.8",
"parse-filepath": "^0.5.0",
"partialify": "^3.1.3",
"path": "^0.11.14",
"require-dir": "^0.3.0",
"run-sequence": "^1.1.1",
"underscore": "^1.8.3",
"underscore-deep-extend": "0.0.5",
"vinyl-buffer": "^1.0.0",
"vinyl-paths": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.2.3"
},
...

Related

Test suite failed to run: node_modules/#react-native/polyfills/error-guard.js: Missing semicolon

I have searched around for this error and found numerous people reporting it, but none of the solution tried have worked for me. The project I'm working with was ejected from expo with react-native v0.63 installed, and then upgraded to react-native v0.64.3. Everything else is working fine, but the tests are failing. On running yarn test, all the unit tests throw the same error:
src/screens/ScreenTest/ScreenTest.test.js
● Test suite failed to run
SyntaxError: /node_modules/#react-native/polyfills/error-guard.js: Missing semicolon. (14:4)
12 | let _inGuard = 0;
13 |
> 14 | type ErrorHandler = (error: mixed, isFatal: boolean) => void;
| ^
15 | type Fn<Args, Return> = (...Args) => Return;
16 |
17 | /**
at instantiate (node_modules/#babel/parser/lib/index.js:72:32)
at constructor (node_modules/#babel/parser/lib/index.js:367:12)
at Parser.raise (node_modules/#babel/parser/lib/index.js:3706:19)
at Parser.semicolon (node_modules/#babel/parser/lib/index.js:4151:10)
at Parser.parseExpressionStatement (node_modules/#babel/parser/lib/index.js:15453:10)
at Parser.parseStatementContent (node_modules/#babel/parser/lib/index.js:14986:19)
at Parser.parseStatement (node_modules/#babel/parser/lib/index.js:14838:17)
at Parser.parseBlockOrModuleBlockBody (node_modules/#babel/parser/lib/index.js:15495:25)
at Parser.parseBlockBody (node_modules/#babel/parser/lib/index.js:15486:10)
at Parser.parseProgram (node_modules/#babel/parser/lib/index.js:14748:10)
at Parser.parseTopLevel (node_modules/#babel/parser/lib/index.js:14735:25)
at Parser.parse (node_modules/#babel/parser/lib/index.js:16764:10)
at parse (node_modules/#babel/parser/lib/index.js:16816:38)
at parser.next (<anonymous>)
at normalizeFile.next (<anonymous>)
at run.next (<anonymous>)
at transform.next (<anonymous>)
at evaluateSync (node_modules/gensync/index.js:251:28)
at sync (node_modules/gensync/index.js:89:14)
at ScriptTransformer.transformSource (node_modules/#jest/transform/build/ScriptTransformer.js:481:35)
at ScriptTransformer._transformAndBuildScript (node_modules/#jest/transform/build/ScriptTransformer.js:586:40)
at ScriptTransformer.transform (node_modules/#jest/transform/build/ScriptTransformer.js:624:25)
at Object.<anonymous> (node_modules/react-native/jest/setup.js:300:6)
Another thing to note is that I have babel.config.js file in my project already, since a lot of answers mentioned moving from .babelrc to babel.config.js as a solution to this problem, but it didn't help. just to be sure i also tried removing the babel.config.js and adding a .babelrc but that did not work either.
I'm at my wits end here and any help is greatly appreciated!
So far I've tried:
Upgrading/downgrading the jest, babel, and any dependencies to a newer version
How can I stop my React Native tests bombing out on Flow types in Node Modules? => Fixes posted in this thread
https://github.com/react-native-community/upgrade-support/issues/152 => More fixes from this issue
Changing babel plugins and adding/removing transformIgnorePatterns
Creating a fresh, bare react-native#0.64.3 project and running the default test (tests pass after downgrading babel to the recommended version)
babel.config.js:
module.exports = function (api) {
api.cache(false)
return {
env: {
production: {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'module:react-native-dotenv',
'react-native-reanimated/plugin',
'transform-remove-console',
],
},
development: {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['module:react-native-dotenv', 'react-native-reanimated/plugin'],
},
},
}
}
package.json:
{
"dependencies": {
"#expo/vector-icons": "^12.0.0",
"#gorhom/bottom-sheet": "^4.4.2",
"#pnthach95/react-native-root-view-background": "^1.2.0",
"#ptomasroos/react-native-multi-slider": "^2.2.2",
"#react-native-async-storage/async-storage": "^1.13.4",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/netinfo": "^8.3.0",
"#react-native-community/push-notification-ios": "^1.8.0",
"#react-native-firebase/analytics": "12.9.3",
"#react-native-firebase/app": "12.9.3",
"#react-native-firebase/auth": "^12.1.0",
"#react-native-firebase/crashlytics": "12.9.3",
"#react-native-firebase/dynamic-links": "10.8.1",
"#react-native-firebase/in-app-messaging": "12.9.3",
"#react-native-firebase/messaging": "^12.1.0",
"#react-native-firebase/perf": "12.9.3",
"#react-native-firebase/remote-config": "12.9.3",
"#react-native-google-signin/google-signin": "^6.0.1",
"#react-native-masked-view/masked-view": "^0.2.6",
"#react-native-picker/picker": "1.9.2",
"#react-navigation/bottom-tabs": "^6.4.0",
"#react-navigation/core": "^5.16.1",
"#react-navigation/native": "^6.0.13",
"#react-navigation/native-stack": "^6.9.6",
"#react-navigation/stack": "^6.3.1",
"#rematch/core": "^2.0.0",
"#rematch/loading": "^2.0.0",
"#sentry/react-native": "^2.6.2",
"#twotalltotems/react-native-otp-input": "^1.3.11",
"accordion-collapse-react-native": "^0.3.2",
"axios": "^0.20.0",
"babel-eslint": "^10.1.0",
"babel-plugin-inline-dotenv": "^1.6.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint-plugin-react-native": "^3.11.0",
"eslint-plugin-unused-imports": "^1.1.1",
"expo": "^40.0.0",
"expo-document-picker": "~8.4.1",
"expo-file-system": "~9.3.0",
"expo-location": "~10.0.0",
"expo-splash-screen": "~0.8.1",
"expo-status-bar": "~1.0.3",
"expo-web-browser": "~8.6.0",
"firebase": "^8.4.3",
"intl": "^1.2.5",
"lodash": "^4.17.20",
"lottie-ios": "3.4.0",
"lottie-react-native": "^5.1.4",
"moment": "^2.29.1",
"moment-duration-format": "^2.3.2",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prop-types": "^15.7.2",
"radio-buttons-react-native": "^1.0.4",
"react": "17.0.2",
"react-calendly": "^4.0.0",
"react-dom": "16.13.1",
"react-intl": "^5.24.6",
"react-native": "0.64.3",
"react-native-appsflyer": "6.8.2",
"react-native-background-timer": "^2.4.1",
"react-native-bootsplash": "^3.2.2",
"react-native-code-push": "^7.0.4",
"react-native-confirmation-code-field": "^6.5.1",
"react-native-date-picker": "^3.2.8",
"react-native-device-info": "^8.0.0",
"react-native-dotenv": "^2.5.0",
"react-native-fast-image": "^8.5.11",
"react-native-fbsdk-next": "^4.2.0",
"react-native-fingerprint-scanner": "^6.0.0",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-image-header-scroll-view": "^0.10.3",
"react-native-image-picker": "~4.2.1",
"react-native-in-app-review": "^4.1.1",
"react-native-inappbrowser-reborn": "^3.5.1",
"react-native-indicators": "^0.17.0",
"react-native-insta-story": "^1.1.8",
"react-native-keyboard-aware-scroll-view": "^0.9.2",
"react-native-linear-gradient": "^2.6.2",
"react-native-modal": "^13.0.0",
"react-native-offline": "^6.0.0",
"react-native-otp-autocomplete": "^1.0.7",
"react-native-pager-view": "5.4.12",
"react-native-paper": "^4.2.0",
"react-native-permissions": "^3.0.0",
"react-native-picker-select": "^8.0.0",
"react-native-play-install-referrer": "^1.1.8",
"react-native-popup-menu": "^0.15.11",
"react-native-portal": "^1.3.0",
"react-native-progress": "^4.1.2",
"react-native-push-notification": "7.3.1",
"react-native-quiz-maker": "^0.1.0",
"react-native-raw-bottom-sheet": "^2.2.0",
"react-native-razorpay": "^2.2.7",
"react-native-reanimated": "~2.5.0",
"react-native-responsive-fontsize": "^0.5.1",
"react-native-restart": "^0.0.22",
"react-native-rss-parser": "https://github.com/adityabishtedu/react-native-rss-parser/tarball/rss-patch",
"react-native-safe-area-context": "3.4.1",
"react-native-screens": "^3.17.0",
"react-native-session-stats": "https://github.com/balazsherczeg/react-native-session-stats.git",
"react-native-shadow-2": "^6.0.5",
"react-native-share": "^7.9.0",
"react-native-signature-canvas": "^4.3.0",
"react-native-simple-toast": "^1.1.3",
"react-native-skeleton-placeholder": "^5.0.0",
"react-native-snap-carousel": "4.0.0-beta.6",
"react-native-step-indicator": "^1.0.3",
"react-native-steps": "^1.3.0",
"react-native-svg": "^12.1.1",
"react-native-tab-view": "^3.1.1",
"react-native-tab-view-fixed": "^0.0.69",
"react-native-thumbnail-video": "^0.1.2",
"react-native-tracking-transparency": "^0.1.1",
"react-native-ultimate-config": "3.4.2",
"react-native-unimodules": "~0.12.0",
"react-native-vector-icons": "^9.1.0",
"react-native-video": "^5.1.1",
"react-native-view-shot": "^3.4.0",
"react-native-walkthrough-tooltip": "^1.1.11",
"react-native-web": "~0.13.12",
"react-native-webp-format": "^1.1.2",
"react-native-webview": "^11.18.1",
"react-native-youtube-iframe": "^2.2.2",
"react-navigation": "^4.4.4",
"react-number-format": "^4.4.1",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"redux-axios-middleware": "^4.0.1",
"redux-thunk": "^2.3.0",
"rn-faded-scrollview": "^1.0.12",
"rn-fetch-blob": "^0.12.0",
"validate.js": "^0.13.1",
"victory-native": "^36.6.0",
"volkeno-react-native-quiz-multiple-choice": "^1.0.3"
},
"devDependencies": {
"#babel/core": "^7.20.5",
"#babel/runtime": "^7.20.6",
"#babel/preset-typescript": "^7.16.5",
"#commitlint/cli": "^17.0.3",
"#commitlint/config-conventional": "^17.0.3",
"babel-jest": "~26.6.3",
"babel-loader": "^8.2.2",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-expo": "8.3.0",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "3.3.0",
"eslint": "^7.32.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.26.0",
"husky": "^8.0.0",
"jest": "~26.6.3",
"metro-react-native-babel-preset": "^0.73.4",
"prettier": "^2.4.1",
"react-native-bundle-visualizer": "^2.2.1",
"react-test-renderer": "17.0.1"
},
"jest": {
"preset": "react-native"
}
}
Unfortunately, I've had the same issue and so I stumbled over your question. After some hours I found the problem and the solution.
In my case the issue happened when I upgraded jest from 27 to 28 (https://jestjs.io/docs/28.x/upgrading-to-jest28) because of this change:
Babel config
babel-jest now passes root: config.rootDir to Babel when resolving configuration. This improves compatibility when using projects with differing configuration, but
it might mean your babel config isn't picked up in the same way anymore. You can override this option by passing options to babel-jest in your configuration.
My babel.config.js was located in my react native application root .\babel.config.js but my .\jest.config.js file defined as root (to search for the tests): rootDir: "src". With the change from 27 to 28 the babel.config.js file was not longer found because babel-jest searched in ./src/babel.config.js and thus exactly the same error occurred like you described above:
SyntaxError: /node_modules/#react-native/polyfills/error-guard.js: Missing semicolon. (14:4)
because babel no longer transpiled the error-guard.js file.
As you have still jest 26 (in your package.json) your case might be different - but the problem is that your babel.config.js file is not or no longer found and thus babel-jest is no longer transpiling any file.
Not sure if this helps you - I used the following solution:
Create a new file ./babel-jest.js with the content
module.exports = require("babel-jest").createTransformer({
rootMode: "upward",
})
Reference this in .\jest.config.js like:
transform: {
"^.+\\.jsx?$": "../babel-jest.js",
},
Now, instead of babel-jest directly the new transformer from .\src\..\babe-jest.js is called including the option to search for the babel.config.js file upwards (and then finally finding it in .\babel.config.js just one level above).
This solution is also described here:
Babel: root programmatic options
and here
https://github.com/facebook/jest/issues/8006
There are other proposals to use:
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { rootMode: 'upward' }],
},
in
https://github.com/facebook/jest/issues/8006
and even on the jest page it self
https://jestjs.io/docs/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object
but unfortunately this was not working for me.
There is another option you can give a try (described also in https://github.com/facebook/jest/issues/8006).
You can create a babel.config.js file in the root for your tests and reference the original file via
module.exports = require('../babel.config.js');
Hope this helps a bit.

How to install all packages from Gatsby V3

I currently have Gatsby installed on version 4, but I wanted to "downgrade" it to version 3, and all dependencies to be compatible with version 3.
Is there any method to "downgrade" everything to the most up-to-date V3 version?
My package.json
"dependencies": {
"#babel/plugin-transform-typescript": "^7.16.1",
"#styled-icons/boxicons-regular": "^10.38.0",
"#types/node": "^16.11.7",
"#types/react": "^17.0.34",
"#types/react-helmet": "^6.1.4",
"gatsby": "^4.1.1",
"gatsby-plugin-gatsby-cloud": "^4.1.0",
"gatsby-plugin-image": "^2.1.2",
"gatsby-plugin-manifest": "^4.1.0",
"gatsby-plugin-offline": "^5.1.0",
"gatsby-plugin-react-helmet": "^5.1.0",
"gatsby-plugin-sharp": "^4.1.3",
"gatsby-source-filesystem": "^4.1.2",
"gatsby-transformer-sharp": "^4.1.0",
"plop": "^2.7.6",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-helmet": "^6.1.0",
"react-icons": "^4.3.1",
"react-markdown": "^7.1.0",
"rehype-raw": "^6.1.0",
"styled-components": "^5.3.3",
"styled-media-query": "^2.1.2",
"swiper": "^7.2.0",
"tslint": "^6.1.3",
"typescript": "^4.4.4"
},
"devDependencies": {
"#babel/core": "^7.16.0",
"#react-icons/all-files": "^4.1.0",
"#storybook/addon-actions": "^6.3.12",
"#storybook/addon-essentials": "^6.3.12",
"#storybook/addon-links": "^6.3.12",
"#storybook/builder-webpack5": "^6.3.12",
"#storybook/manager-webpack5": "^6.3.12",
"#storybook/react": "^6.3.12",
"#types/react-dom": "^17.0.11",
"#types/styled-components": "^5.1.15",
"#types/swiper": "^5.4.3",
"#typescript-eslint/eslint-plugin": "^5.3.1",
"#typescript-eslint/parser": "^5.3.1",
"babel-loader": "^8.2.3",
"babel-plugin-styled-components": "^1.13.3",
"chromatic": "^6.0.6",
"eslint": "^8.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.27.0",
"eslint-plugin-react-hooks": "^4.3.0",
"gatsby-plugin-scss-typescript": "^5.1.0",
"gatsby-plugin-styled-components": "^5.1.0",
"gatsby-plugin-typescript-scss-modules": "^1.0.7",
"prettier": "^2.4.1",
"storybook-addon-gatsby": "^0.0.2"
},
There's no magic command to downgrade automatically Gatsby version and all related dependencies. Basically, you need uninstall and reinstall Gatsby to your desired version:
If you need to reset your gatsby-cli version:
npm uninstall -g gatsby-cli
npm install -g gatsby-cli#latest
After that:
npm install gatsby#3.14
Where 3.14 is your desired version (according to the releases notes it should be 3.14).
Then, you will need to run:
npm outdated
To fix your dependency versions.
You'll need to remove the node_modules and the package-lock.json before installing and auditing the packages to avoid locked dependencies and odd behaviors.

Does publishing to NPM add dependencies?

The package react-canvas-draw has the following in its package.json on GitHub:
"dependencies": {
"catenary-curve": "^1.0.1",
"lazy-brush": "^1.0.1",
"prop-types": "^15.6.2",
"resize-observer-polyfill": "^1.5.0"
},
"peerDependencies": {
"react": "16.x"
},
"devDependencies": {
"all-contributors-cli": "^5.4.1",
"babel-eslint": "^7.2.3",
"css-loader": "^0.28.9",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^4.1.1",
"eslint-config-react-app": "^2.1.0",
"eslint-plugin-flowtype": "^2.34.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.1.0",
"gh-pages": "^1.1.0",
"nwb": "0.21.x",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"style-loader": "^0.19.1"
},
However, when I view the package on NPM, I see:
"dependencies": {
"catenary-curve": "^1.0.1",
"codecov": "^3.5.0", // <-- note
"coveralls": "^3.0.4", // <-- note
"lazy-brush": "^1.0.1",
"prop-types": "^15.6.2",
"resize-observer-polyfill": "^1.5.0"
},
"peerDependencies": {
"react": "16.x"
},
"devDependencies": {
"all-contributors-cli": "^5.4.1",
"babel-eslint": "^7.2.3",
"css-loader": "^0.28.9",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint": "^4.1.1",
"eslint-config-react-app": "^2.1.0",
"eslint-plugin-flowtype": "^2.34.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.1.0",
"gh-pages": "^1.1.0",
"nwb": "^0.21.5",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"style-loader": "^0.19.1"
},
I noted above the two additional packages that I see: codecov and coveralls. They're also displayed in the user-friendly site.
Why are these in the NPM package entry, but not in the GitHub source?
My only thought: the words codecov and coveralls only really exist in the .travis.yml file:
before_install:
- npm install codecov coveralls
- npm install nwb
...So, npm publish is detecting the npm install commands and adding dependencies to package.json? I can't find anything to support this, but I don't have any better ideas.
You're correct in your assumption, executing npm install as of NPM v5 will add them to the package.json as dependencies. The subsequent npm publish that travis runs is then including this "updated" dependency list in the package.
It's interesting that they're shipping with those packages, as they're primarily "dev dependencies" so don't need to be included in the distributed bundle. You may want to open an issue or pull request that either declares these as dev dependencies in the package.json or includes a --save-dev in the .travis.yml.
(Though the latter would not be that great either as it would "add" those as dev deps of the published module that are not reflected on the github source).

why npm install no needed package?

I want to know what make "npm install" install #angula from this package.json dependecies ?
"dependencies": {
"#trust/webcrypto": "^0.9.0",
"body-parser": "^1.18.2",
"civic-sip-api": "^1.0.1",
"cookie-parser": "^1.4.3",
"cors": "^2.8.4",
"ethereumjs-testrpc": "^6.0.3",
"express": "^4.16.3",
"express-jwt": "^5.3.1",
"gun": "^0.9.993",
"ipfs": "^0.28.2",
"jsonwebtoken": "^8.2.1",
"md5": "^2.2.1",
"orbit-db": "^0.19.7",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"sha3": "^1.2.0",
"socket.io": "^2.1.0",
"socketio-jwt": "^4.5.0",
"uport-connect": "^0.7.2",
"web3": "^0.20.6"
},
after running "npm install" in the project folder I got some non needed package such as #angular, #angular-devkit, #ngtools
They are dependencies of each module. If you open up each module it has a package.json with the dependencies of the installing module.

npm install dosen't install dev dependencies

I have a project where I use npm for handling dependencies. The project is bundled with Webpack and will run on the client (it's built for using gh-pages for hosting) with no production dependencies. Therefore I have only devDependencies in my package.json. However, when I run npm install nothing gets installed. When I run npm install --dev my dependencies gets installed as they are supposed to. Since --dev is deprecated I tried with npm install --only=dev as well, however nothing gets installed then either! Is there something broken in my package.json (inserted below) or am I misunderstanding npm?
{
"name": "Boilerplate",
"version": "0.0.1",
"description": "A boilerplate to quickly get started with an offline first React/Redux app",
"repository": {
"type": "git",
"url": "https://github.com/OskarKlintrot/Offline-First-React-And-Redux-Boilerplate"
},
"scripts": {
"start": "webpack-dev-server",
"build": "webpack --progress --colors --production"
},
"private": true,
"devDependencies": {
"babel-core": "^6.2.1",
"babel-eslint": "^4.0.5",
"babel-loader": "^6.2.0",
"babel-polyfill": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"babel-preset-stage-1": "^6.1.18",
"eslint": "^1.1.0",
"eslint-loader": "^1.0.0",
"eslint-plugin-react": "^3.13.1",
"file-loader": "^0.8.5",
"history": "^1.17.0",
"react": "^0.14.2",
"react-dom": "^0.14.2",
"react-hot-loader": "^1.3.0",
"react-mdl": "^1.0.2",
"react-redux": "^4.0.4",
"react-router": "^1.0.2",
"react-tap-event-plugin": "^0.2.1",
"redux": "^3.0.5",
"redux-devtools": "^3.0.0",
"redux-devtools-dock-monitor": "^1.0.1",
"redux-devtools-log-monitor": "^1.0.1",
"redux-history-transitions": "^1.0.0",
"redux-thunk": "^1.0.2",
"transfer-webpack-plugin": "^0.1.4",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
}
}