Exploring the differences between dependencies and devDependencies in the Ember package.json file

What is the distinction between placing packages under the dependencies or devDependencies in the package.json file?

How does this affect the final build outcome?

It seems straightforward, but I'm unsure which packages should go in each section. Even documentation for similar add-ons can differ, with some advising the use of --save and others --save-dev, causing confusion.

Answer №1

When working with an ember app, all dependencies are typically placed under the devDependencies section. This is because the app is built using the ember cli and is not included in another project.

However, the situation changes when dealing with addons. If an addon exposes functionality from a package, that particular package must be listed under the dependencies section.

Answer №2

Check out your package.json file and you'll notice two categories of dependencies. One is known as devDependencies (typically modules required for local development) and the other is dependencies (used in production or crucial to the project). By using the --save flag, you add dependencies to the dependencies section of your package.json, while --save-dev adds them to devDependencies. This separation provides organizational clarity.

Note: This question has already been addressed here, but essentially, it does not impact your production build. Hopefully, this explanation helps.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The multi-phase Docker build process fails to transfer files generated in the preceding stage

I am facing an issue with my Django app's Docker build, which consists of two stages: The first stage uses a Node image to compile static assets using Gulp. This stage creates the node_modules directory and a folder named build. The second stage is s ...

Issue arises when attempting to run npm start on Windows 10 due to node-gyp failing

After setting up Node.js version 12.18.1 and Python v3.8.1 on my Windows 10 system, I encountered an issue when trying to run npm install in a project: gyp ERR! configure error gyp ERR! stack Error: Command failed: C:\Program Files (x86)\Python&b ...

An error of 'Address already being used' encountered while utilizing cookiecutter-flask

My operating system is OS X 10.14.3 and I am attempting to utilize the impressive cookiecutter-flask project. I have diligently followed the instructions provided in the README.rst: cookiecutter https://github.com/sloria/cookiecutter-flask.git # My test p ...

What serves as the pip counterpart to package.json?

While I am familiar with the requirements.txt file, it only lists dependencies. However, I'm interested in other metadata such as package name, author, and main function. Is there a standard format for this information? I've heard of the setup.p ...

Developed and deployed a Debian package, however, upon execution, it displays an error message stating 'command not recognized'

I am in the process of converting a basic Python program into a Debian package for Linux. To achieve this, I have created a directory /testhello, with subdirectories testhello/DEBIAN and testhello/usr. Within testhello/DEBIAN, there is a control file cont ...

Tips for installing npm packages using a python script in the same directory as my script

The desired file structure should resemble this: test.py node_modules (Folder containing installed npm modules) Here is the attempted solution: import subprocess import os dir_path = os.path.dirname(os.path.realpath(__file__)) # Retrieve the directory ...

I am encountering the issue where Prisma client python consistently notifies me that my client has not been generated, despite the fact that I have already executed the necessary

After setting up Prisma Client Python and SQLite to create a database for my program successfully, I encountered an issue when trying to run my program. Despite ensuring that everything was installed correctly and running commands like "prisma generate" an ...

During the installation of bcrypt using npm, an error occurred with gyp related to

Encountering errors while attempting to install bcrypt on Windows 10 with node:v6.7.0, npm:v4.0.1, and node-gyp:v3.4.0. Even though python27 and python35-32 are both in my path, I am facing the following issues: D:\myApp\node_modules\bc ...

A guide on executing Python scripts and using CMD within a Dockerfile to manage a Docker container

In my current scenario, I have an image that is using a customized Dockerfile. Upon starting the container, I am aiming to execute CMD ["npm", "start"]. However, prior to that command execution, there are three different scripts that need to run. I attemp ...

The file "tfjs_binding.node" could not be located in the directory where @tensorflow is installed

After attempting to utilize certain functionalities of TensorFlow, I encountered an error indicating that "tfjs_binding.node" was not found in the @tensorflow installation folder. I made sure to install Python 2.7 as a prerequisite for TensorFlow and veri ...

Using a separate iteration of Python while conducting an NPM installation

I have admin privileges on a VPS running CentOS 5.9 with Python 2.4.3 installed by default. I decided to upgrade to Python 2.7.3 using the commands below (I opted for make altinstall instead of make install): wget http://www.python.org/ftp/python/2.7.3/Py ...

Having trouble installing an npm package with your Python script?

Here is the Python code I am struggling with: import subprocess subprocess.Popen(["npm", "install", "express"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) Unfortunately, this code isn't working as exp ...

An error occurred: gyp ERR! stack - The command `python -c import sys; print "%s.%s.%s" % sys.version_info[:3]` has failed

While attempting to npm install in a Vue project, I encountered an error even after running vue create (name): npm ERR! gyp verb check python checking for Python executable "c:\Python310\python.exe" in the PATH npm ERR! gyp verb `which` ...

Structure of Python Package Directory

After extensive research on creating a customized folder structure for a Python package, I found that existing methods were not widely applicable. One particular challenge was determining the necessity of using the \__init__.py file(s). My package in ...