1

I am using the Angular 2 version. I used to install the bootstrap through node.js command prompt.

npm install ngx-bootstrap --save 

and I added the .csproj like this. This is to deploy my application on the server through octopus, but I am getting this issue while building my solution on a local machine.

Error: The command "npm install ngx-bootstrap --save" exited with code 1.

Packages.json:

{ "version": "1.0.0", "name": "mywizard-ad", "private": true, "scripts": { "build-Debug": "webpack --config webpack.debug.js --env.WebApiEnv dev", "build-Release": "webpack --config webpack.prod.js --env.WebApiEnv dev", "build-Prod": "webpack --config webpack.prod.js --env.WebApiEnv prod", "build-Stage": "webpack --config webpack.prod.js --env.WebApiEnv stage", "build-UAT": "webpack --config webpack.prod.js --env.WebApiEnv uat", "build-Preprod": "webpack --config webpack.prod.js --env.WebApiEnv preprod", "build-Prod_EU": "webpack --config webpack.prod.js --env.WebApiEnv prod_eu", "build-Stage_EU": "webpack --config webpack.prod.js --env.WebApiEnv stage_eu", "build-Hotfix": "webpack --config webpack.prod.js --env.WebApiEnv hotfix" }, "dependencies": { "@angular/common": "~4.3.1", "@angular/core": "~4.3.1", "@angular/http": "~4.3.1", "@angular/platform-browser": "~4.3.1", "@angular/platform-browser-dynamic": "~4.3.1", "@angular/router": "~4.3.1", "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.4", "@types/jquery": "^3.2.12", "angular2-moment": "^1.7.0", "core-js": "^2.4.1", "file-saver": "^1.3.3", "html-webpack-plugin": "^2.30.1", "jquery": "^3.2.1", "ng2-simple-global": "^1.2.5", "ngx-bootstrap": "^2.0.0-beta.7", "rxjs": "^5.1.0", "systemjs": "0.19.39", "zone.js": "^0.8.4" }, "devDependencies": { "@angular/common": "~4.3.1", "@angular/compiler": "~4.3.1", "@angular/core": "~4.3.1", "@angular/forms": "~4.3.1", "@angular/http": "~4.3.1", "@angular/platform-browser": "~4.3.1", "@angular/platform-browser-dynamic": "~4.3.1", "@angular/router": "~4.3.1", "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.4", "@types/file-saver": "0.0.1", "@types/node": "^6.0.45", "clean-webpack-plugin": "^0.1.16", "core-js": "^2.4.1", "html-loader": "^0.5.1", "html-webpack-plugin": "^2.30.1", "jquery": "^3.2.1", "ng2-simple-global": "^1.2.5", "rxjs": "^5.1.0", "systemjs": "0.19.39", "typescript": "^2.0.0", "webpack": "^3.5.6", "webpack-concat-plugin": "^1.4.1", "webpack-merge": "^4.1.0", "zone.js": "^0.8.4" }, "repository": {} } 
12
  • Please paste your package.json Commented Oct 23, 2017 at 8:44
  • Is there no other errors output? Commented Oct 23, 2017 at 10:19
  • no, it's pointing to my .csproj Commented Oct 23, 2017 at 10:22
  • Sorry, I did not get the point. What is pointing to my.csproj? Commented Oct 23, 2017 at 10:27
  • D:\Builds\87\828\Sources\4577_MywizardAD\4577_MyWizardAD.csproj (664): The command "npm install ngx-bootstrap --save" exited with code 1. this is exactly am getting Commented Oct 23, 2017 at 10:32

1 Answer 1

1

The issue is not related to npm but to your settings in my.csproj file. Actually you don't need to use this file to install your npm modules. The .csproj file is used by Visual Studio to organize your project. So there is no need from your part to edit them for your dependencies.

The npm flag --save will save the module as a dependency in your package.json. It is useful when you git clone the project. After cloning the project, npm install will install all the packages that you have installed previously with the flag --save. You don't need to have those lines in your .csproj file, especially if they make your npm install fail.

You can try this:

  • Comment the lines in your my.csproj file
  • Run manually the command locally (you can check that you will have an entry corresponding to those dependencies in your "package.json"; if they are already there, it means that all the dependencies are already installed, i.e you can skip this step)
  • Commit your new "package.json" file
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.