Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install : unable to install dependencies in Windows 10

I am using Windows 10 and installed node-v6.9.1-x64.

Here is the project link which I am trying to build for Android platform and for that I am following steps as mentioned there, like:

  1. First of all I have downloaded this project and unzip to Ionic folder in D drive and renamed it to IonicUserBase

  2. Second, I have already Ionic and Cordova installed, so I directly started with navigate to project

  3. Third to install all dependencies, I am using : npm install

But unable to install dependecies .... see complete log below

D:\>cd Ionic

D:\Ionic>cd IonicUserBase

D:\Ionic\IonicUserBase>npm install
npm WARN deprecated [email protected]: Please use gulp-clean-css
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

> [email protected] install D:\Ionic\IonicUserBase\node_modules\node-sass
> node build.js

(node:6292) DeprecationWarning: child_process: options.customFds option is deprecated. Use options.stdio instead.

D:\Ionic\IonicUserBase\node_modules\node-sass>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Ionic\IonicUserBase\node_modules\node-sass
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
Build failed
[                 .] | install: info lifecycle [email protected]~install: Failed to exec install script[                 .] | install: info lifecycle [email protected][email protected] D:\Ionic\IonicUserBase
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | | `-- [email protected]
| | | +-- [email protected]
| | | | `-- [email protected]
| | | +-- [email protected]
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | | +-- [email protected]
| | | | | | `-- [email protected]
| | | | | |   +-- [email protected]
| | | | | |   +-- [email protected]
| | | | | |   | `-- [email protected]
| | | | | |   +-- [email protected]
| | | | | |   `-- [email protected]
| | | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | | `-- [email protected]
| | | | +-- [email protected]
| | | | +-- [email protected]
| | | | | +-- [email protected]
| | | | | | `-- [email protected]
| | | | | `-- [email protected]
| | | | +-- [email protected]
| | | | | +-- [email protected]
| | | | | | `-- [email protected]
| | | | | `-- [email protected]
| | | | `-- [email protected]
| | | |   +-- [email protected]
| | | |   `-- [email protected]
| | | `-- [email protected]
| | |   `-- [email protected]
| | |     +-- [email protected]
| | |     | +-- [email protected]
| | |     | +-- [email protected]
| | |     | | `-- [email protected]
| | |     | `-- [email protected]
| | |     |   `-- [email protected]
| | |     `-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | `-- [email protected]
| | |   +-- [email protected]
| | |   | `-- [email protected]
| | |   |   `-- [email protected]
| | |   |     `-- [email protected]
| | |   +-- [email protected]
| | |   `-- [email protected]
| | |     `-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | |   `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| `-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | +-- [email protected]
|   | | `-- [email protected]
|   | +-- [email protected]
|   | | `-- [email protected]
|   | +-- [email protected]
|   | | `-- [email protected]
|   | |   +-- [email protected]
|   | |   `-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | | `-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   |   `-- [email protected]
|   |     +-- [email protected]
|   |     | +-- [email protected]
|   |     | `-- [email protected]
|   |     +-- [email protected]
|   |     `-- [email protected]
|   |       +-- [email protected]
|   |       `-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | +-- [email protected]
|   | `-- [email protected]
|   +-- [email protected]
|   | `-- [email protected]
|   `-- [email protected]
|     `-- [email protected]
+-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| `-- [email protected]
|   +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | +-- [email protected]
|   | `-- [email protected]
|   `-- [email protected]
+-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| |   `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| `-- [email protected]
|   `-- [email protected]
+-- [email protected]
+-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| |   +-- [email protected]
| |   | `-- [email protected]
| |   +-- [email protected]
| |   +-- [email protected]
| |   | +-- [email protected]
| |   | | `-- [email protected]
| |   | `-- [email protected]
| |   +-- [email protected]
| |   +-- [email protected]
| |   | +-- [email protected]
| |   | +-- [email protected]
| |   | | `-- [email protected]
| |   | `-- [email protected]
| |   |   +-- [email protected]
| |   |   | `-- [email protected]
| |   |   `-- [email protected]
| |   +-- [email protected]
| |   +-- [email protected]
| |   | +-- [email protected]
| |   | | +-- [email protected]
| |   | | `-- [email protected]
| |   | |   `-- [email protected]
| |   | `-- [email protected]
| |   |   +-- [email protected]
| |   |   | +-- [email protected]
| |   |   | +-- [email protected]
| |   |   | | `-- [email protected]
| |   |   | |   `-- [email protected]
| |   |   | +-- [email protected]
| |   |   | `-- [email protected]
| |   |   `-- [email protected]
| |   +-- [email protected]
| |   | +-- [email protected]
| |   | | `-- [email protected]
| |   | |   `-- [email protected]
| |   | |     `-- [email protected]
| |   | `-- [email protected]
| |   `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | | `-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected]
| | | `-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| +-- [email protected]
| | `-- [email protected]
| +-- [email protected]
| | +-- [email protected]
| | `-- [email protected]
| `-- [email protected]
|   `-- [email protected]
`-- [email protected]

npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Ionic\IonicUserBase\npm-debug.log

D:\Ionic\IonicUserBase>

UPDATED:

I have tried the way suggested by @mscdex and here is the new log, still getting build failed while using npm install and one more thing now I have installed another version of nodejs (i.e. node-v4.2.1-x64)

like image 306
Sonali Avatar asked Oct 29 '16 05:10

Sonali


People also ask

Can't install dependencies npm?

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. Try the below command to install the dependencies for your project.

Why is my npm install not working?

If your npm is broken: On Mac or Linux, reinstall npm. Windows: If you're on Windows and you have a broken installation, the easiest thing to do is to reinstall node from the official installer (see this note about installing the latest stable version).

How do I install npm files on Windows 10?

For Node. js projects, the easiest way to install npm packages is through the npm package installation window. To access this window, right-click the npm node in the project and select Install New npm Packages. In this window you can search for a package, specify options, and install.


3 Answers

I cloned the project and tried the same.

By adding PythonPath to the Windows environment and updating the gulp-sass to it's latest version I am able to build the project successfully

Step 1:

Download Python 2.7.12 from here

And set the environment variable PATH to /path/to/executable/python2.7 (eg: C:\Python27\python.exe)

OR

open cmd as administrator and run

npm install --g --production windows-build-tools 

I have done both.

Step 2:

Open your package.json (D:\Ionic\IonicUserBase\package.json)

change the version of gulp-sass from "gulp-sass": "^0.7.1" to it's latest version "gulp-sass": "^2.3.2"

now try npm install

It should work fine.

Summary: Let me summarize the entire flow

Open cmd as admin

npm install -g cordova ionic
npm install --g --production windows-build-tools from cmd as administrator
git clone https://github.com/malikov/Authenticate.me-client-cordova-ionic.git
cd Authenticate.me-client-cordova-ionic 

In package.json change the version of gulp-sass to it's latest version. "gulp-sass": "^2.3.2"

npm install
ionic platform add android
ionic run android
like image 91
Newton Joshua Avatar answered Oct 14 '22 16:10

Newton Joshua


I had a similar version i solved by installing python 2.7

npm install --python=python2.7

or set it to be used always:

npm config set python python2.7

Also i had visual stdio 2015 and 2012 installed.

npm install --global --production windows-build-tools
like image 28
M14 Avatar answered Oct 14 '22 18:10

M14


node-sass is a node addon, so it needs to be compiled. However, you don't have at least Python installed to be able to compile addons.

On Windows, you should be able to install everything you need by just doing this (either from an elevated PowerShell session or from a command prompt ran as Administrator):

npm install --global --production windows-build-tools

Once that successfully completes, re-run your original npm install.

EDIT: After reading your npm install log, it appears that you are depending on an old version of gulp-sass since a really old version of node-sass is being installed (node-sass v0.9.6 was released in 2014). Try installing and using the latest version of gulp-sass (v2.3.2 as of this writing) instead, which should bring in a much more recent node-sass that is compatible with modern versions of node.

like image 28
mscdex Avatar answered Oct 14 '22 16:10

mscdex