Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm install doesn't work (no errors), but npm install <package> does

Tags:

node.js

npm

noob question regarding Node and npm: I have a package.json file with a list of dependancies that I want to install with npm install. When I run the command, nothing happens, I don't even receive an error, nothing at all :( But if I try to install a single package from the list, it works perfectly... I haven't created the package.json myself, so I am not sure what the "proxyURL" thing does...

{
  "name": "dss",
  "version": "0.0.0",
  "repository": {
    "type": "git",
    "url": "*urlofmyrepo*"
  },
  "dependencies": {
    "bower": "^1.7.7",
    "cssmin": "^0.4.3",
    "gulp": "^3.9.0",
    "gulp-batch": "^1.0.5",
    "gulp-concat": "^2.6.0",
    "gulp-if": "^2.0.0",
    "gulp-jshint": "^2.0.0",
    "gulp-rename": "^1.2.2",
    "gulp-sass": "^2.2.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-strip-debug": "^1.1.0",
    "gulp-uglify": "^1.5.1",
    "gulp-util": "^3.0.7",
    "gulp-watch": "^4.3.5",
    "jshint": "^2.9.1",
    "lodash": "^4.2.1",
    "minimatch": "^3.0.0",
    "sass": "^0.5.0",
    "uglifyjs": "^2.4.10",
    "underscore": "^1.8.3",
    "yuglify": "^0.1.4"
  },
  "private": true,
  "APIMethod": "stub",
  "proxyURL": "http://localhost:8000",
  "devDependencies": {}
}

Any clue? Thank you

like image 592
Laura Silvani Avatar asked Apr 07 '16 08:04

Laura Silvani


People also ask

Why is my npm install not working?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.

How do I force an npm package to install?

The -f or --force argument will force npm to fetch remote resources even if a local copy exists on disk. The -g or --global argument will cause npm to install the package globally rather than locally.

Why npm command is not working on CMD?

The error “npm is not recognized as an internal or external command” error may occur because either the npm is not installed or it is not added to the windows path. To resolve this error, the first solution is to install Node. js on Windows as Node. js is equipped with npm by default.

Does npm install install all packages?

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 .


1 Answers

Rename/remove your package.json file.

Create a new package file by running:

npm init

Option A: Copy the dependencies you need into the newly created package.json.

Option B: Install the packages and use --save to add the packages to the package.json file.

Run npm install to install the dependencies.

like image 138
Ralf de Kleine Avatar answered Nov 11 '22 01:11

Ralf de Kleine