I've created a package.json
file for my private app. In it, I have my dependencies listed, as expected. Some of those dependencies have dependencies of their own. When running npm install
on my app, it's not installing the dependencies of my dependencies. Is there something wrong with my package.json file which is preventing this? ("winston" is one of my dependencies which isn't properly installing)
{
"name": "my app",
"version": "0.0.1",
"dependencies" : {
"connect" : "1.8.5",
"express" : "2.5.8",
"socket.io" : "0.8.7",
"winston" : "0.5.9"
},
"engine": {
"node": ">=0.6"
}
}
Reponse to comments: NPM installs the top level deps, fine, no errors, it looks like it works. It just never downloads the deps of the deps. Will try the -d option.
Install the dependencies to 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.
The easiest way to fix the issue is to pass an additional parameter –legacy-peer-deps to npm install. The --legacy-peer-deps tells the npm to ignore the peer dependencies and continue the installation of the package.
When you (or another user) run npm install , npm will download dependencies and devDependencies that are listed in package. json that meet the semantic version requirements listed for each.
Development and Production Dependencies We can also have dependencies that are used for both development and production. When we install a package with npm, it's automatically added as a general dependency, which is for both dev and production.
Spaces are not allowed in the name
option for package.json files.
The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can't contain any non-URL-safe characters.
https://docs.npmjs.com/files/package.json#name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With