Italo Rodrigo
Italo Rodrigo

Reputation: 1785

How do I see the installed modules?

How do can I see a complete list of the modules installed by ´npm install´ command?

Example: npm list react-native-modules

Upvotes: 4

Views: 15638

Answers (3)

Mohammed Ashfaq
Mohammed Ashfaq

Reputation: 3426

The below command will give you the list of npm packages installed in the current directory.

npm ls --depth=0

You can set the depth value to see the dependency of the installed packages. i.e. npm ls --depth=1

To get the list of globally installed npm package list

npm ls -g --depth 0

Upvotes: 11

subhashis
subhashis

Reputation: 4888

You can find them in package.json -> dependencies eg:

"dependencies": {
"@chakra-ui/react": "^1.6.5",
"@emotion/react": "^11.4.0",
"@emotion/styled": "^11.3.0",
"@react-icons/all-files": "^4.1.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"axios": "^0.21.1",
"bootstrap": "^4.6.0",
"formik": "^2.2.9",
"framer-motion": "^4.1.17",
"react": "^17.0.2",
"react-bootstrap": "^1.6.1",
"react-datepicker": "^4.1.1",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-modal": "^3.14.3",
"react-scripts": "4.0.3",
"react-toastify": "^7.0.4",
"web-vitals": "^1.1.2",
"yup": "^0.32.9"

},

Upvotes: 3

cameck
cameck

Reputation: 2098

If you are not adding any arguments to the npm install command, it installs all items in your package.json. There are all installed in that directory in the node_modules folder.
This is a faculty of NPM and does not really have anything specifically to do with React Native (which makes me hope I understand your question correctly :\ ).

Either way, here are more details on the command from the NPM docs:

npm install (in package directory, no arguments):

Install the dependencies in the local node_modules folder.

In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package.

By default, npm install will install all modules listed as dependencies in package.json.

With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies.

EDIT: You can also see all packages + dependencies installed in a Tree-like structure with npm ls, just make sure you are in your project directory. -- more data here

Upvotes: 2

Related Questions