Saad
Saad

Reputation: 687

npm install is partially cloning the source from git repo

When I run npm i command it partially clones the code from bitbucket repo. Here are some dependencies in package.json

"dependencies": {
   "bluerain-app-hello-world": "git+ssh://[email protected]/projects/bluerain-app-hello-world.git#build_issue",
   "graphql-tag": "0.1.16" }

And this is the source of my module enter image description here

But when i list down cloned rope from node_module by

ls node_modules/bluerain-app-hello-world/

It gives this list

index.js  node_modules  package.json  README.md  src

There is a dist folder in my source but it didnt clone properly. I tried to remove my node modules and reinstall it but it didnt work. Any suggestions please?

Upvotes: 4

Views: 1499

Answers (1)

Saad
Saad

Reputation: 687

I started working on a boilerplate who had added the files array field in package.json and specified only the src folder. This is why when my node module installed, it didn't contain the dist folder.

According to official documentation

The "files" field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. (Unless they would be ignored by another rule.)

You can also provide a ".npmignore" file in the root of your package or in subdirectories, which will keep files from being included, even if they would be picked up by the files array. The .npmignore file works just like a .gitignore.

Upvotes: 3

Related Questions