user1072337
user1072337

Reputation: 12935

npm packages installed from command line not appearing in packages.json dependencies for React-Native project

I have a React-Native project and I'm trying to install certain npm modules in my project.

However, when I try to do so from the command line, the packages says it is installed correctly, but it is not appearing in the packages.json dependency.

For instance, I installed react-relay using npm install react-relay.

The package looks to have installed correctly. But I check my packages.json and react-relay is not in there.

I have tried react-native link, and the packages are not coming up.

What is going on?

Upvotes: 1

Views: 398

Answers (2)

Pir Shukarullah Shah
Pir Shukarullah Shah

Reputation: 4232

You need to add save option

npm install react-relay --save

or

npm i react-relay --s

To remove node module from package.json file

npm uninstall react-relay --save

Here is documentation for npm install

Upvotes: 0

Ethan Cabiac
Ethan Cabiac

Reputation: 4993

you would need to use the "save" option: npm install react-relay --save

Upvotes: 3

Related Questions