Npm install fails on windows

Npm install hangs and fails on windows 10

My npm installs on windows 10 with the most up to date node.js and npm stable versions always fail when I enter the command npm install while cd’d into my project folder. This specific folder was set up with express as described here. Below is the relevant portion of the verbose failure log. I have no idea what is going wrong, can anyone help?

1315 verbose stack Error: ENOENT: no such file or directory, rename ‘C:\Users\carte\Desktop\Queue\Queue\node_modules\amdefine’ -> ‘C:\Users\carte\Desktop\Queue\Queue\node_modules.amdefine.DELETE’ 1316 verbose cwd C:\Users\carte\Desktop\Queue\Queue 1317 verbose Windows_NT 10.0.16299 1318 verbose argv «C:\Program Files\nodejs\node.exe» «C:\Users\carte\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js» «install» «—verbose» 1319 verbose node v8.11.0 1320 verbose npm v5.8.0 1321 error path C:\Users\carte\Desktop\Queue\Queue\node_modules\amdefine 1322 error code ENOENT 1323 error errno -4058 1324 error syscall rename 1325 error enoent ENOENT: no such file or directory, rename ‘C:\Users\carte\Desktop\Queue\Queue\node_modules\amdefine’ -> ‘C:\Users\carte\Desktop\Queue\Queue\node_modules.amdefine.DELETE’ 1326 error enoent This is related to npm not being able to find a file. 1327 verbose exit [ -4058, true ]

3 Answers 3

I know this is old, but I had currently this problem and couldn’t find answers, so I post my solution, in case it helps someone else.

My problem was that I have npm install on C:\ and my project (or git folder) in G:\.
Moving my folder from G:\ to C:\Desktop and running npm install solved it for me.

I am not sure if it was because of moving it to C:\ or if it was because of moving it outside git-folder.

Edit: before that I actually cleaned npm cached using —force .
I’m using npm v6.7.0 and node v10.15.1

npm install not working in windows

I have no idea what is happening here. Hoping someone can help me.

This works great in my mac. But same process in Windows and npm install crashes. This is what I get.

I’ve tried everything I’ve seen in SO so far and every link Google search produced. I tried the following as suggested here:

Ran it as admin,

tried npm install -g

re-started xampp server

turned off Windows defender

checked the PATH for C:\Program Files\nodejs

Short of throwing this POS Windows threw a window, pun intended, I’ve done everything. Hail Apple!

node -v gives me a version v6.9.1

npm -v gives me a version as well 4.0.2

Which proves they are all installed fine, am I right?

5 Answers 5

After countless hours of debugging and researching, I decided to install in a different machine to see if the problem was with my Node installation. It worked.

So for everyone who may come across this, know that the possibility to uninstall node and delete NPM will be there. This is what I did. I believe it is the safest way to solve the problem and all the rest of your applications installed in your machine will still work. I credit this answer for these steps, although I had other npm and node_modules in other locations. So do a quick search for these and unless they are part of an application, make sure they are deleted as well.

Читайте также:  Отключить аппаратное ускорение видеокарты windows 10

Uninstall from Programs & Features with the uninstaller.

Reboot (or you probably can get away with killing all node-related processes from Task Manager).

Look for these folders and remove them (and their contents) if any still exist. Depending on the version you installed, UAC settings, and CPU architecture, these may or may not exist:

  • C:\Program Files (x86)\Nodejs
  • C:\Program Files\Nodejs
  • C:\Users\\AppData\Roaming\npm (or %appdata%\npm )
  • C:\Users\\AppData\Roaming\npm-cache (or %appdata%\npm-cache )
  • C:\Users\\.npmrc (and possibly check for that without the . prefix too)

Check your %PATH% environment variable to ensure no references to Nodejs or npm exist.

If it’s still not uninstalled, type where node at the command prompt and you’ll see where it resides — delete that (and probably the parent directory) too.

npm install fails on Windows 10 w/ node v5.10.1 / npm 3.8.3 #1367

Comments

bsclifton commented Apr 14, 2016

I forked the repo (I’d like to start contributing) and I cloned it on my local machine. I have the following versions of software:

  • Windows 10 (64 bit, version 1511 OS Build 10586.218)
  • GitHub shell (3.0.17.0)
  • nodejs (v5.10.1)
  • npm (3.8.3)
  • python (2.7.10)
  • Visual Studio (Community — 2015 Update 2)

Per the build section, I installed node-gyp: npm install -g node-gyp@3.2.1

Here are the relevant logs when doing an npm install (full logs attached):

The text was updated successfully, but these errors were encountered:

bsclifton commented Apr 14, 2016

I’m going to dig in and work on resolving this too; I just wanted to capture it in case anyone else had the same issue (give it a +1 or leave a comment if so). If I do find a resolution, I’ll close this and add the fix to the troubleshooting wiki.

I usually use Cygwin, but npm install has a known issue

bbondy commented Apr 14, 2016

I recently setup a new windows machine and got it working.
In my situation I had VS 2013 and VS2015. For some reason I couldn’t get it to work with VS2015 so I had to set an environment for:

GYP_MSVS_VERSION
and set the value to
2013

Then it started working for me.

bsclifton commented Apr 15, 2016 •

So I fixed the npm issue in Cygwin (and submitted a PR). after that was fixed, npm install worked great for me. I’m curious why it worked? Did the install default to using Cygwin’s compiler instead of msbuild?

bbondy commented Apr 15, 2016

I’m using mozilla-build bash shell btw. Awesome that you fixed in that PR though!

bsclifton commented Apr 15, 2016

I’ll do my best to get it working in the Github shell, since a lot of folks are using that too! Hopefully, it’s not hard to get to the bottom of it and then I can help jump in and start helping resolve other issues. I confirmed I can launch the browser via npm start and looking forward to grabbing this issue specifically 😄

bsclifton commented Apr 17, 2016 •

Dug into this tonite and didn’t make much progress, but I do understand the issue now. I logged a comment with more information to the node-gyp repo; I’ll continue looking into solutions.

Like I called out above, I was able to get npm install working great on Cygwin after patching npm. Unfortunately, my PR was closed, so I’d really like to help get this working in a Windows shell that is considered «supported» by npm, Inc.

bsclifton commented Apr 17, 2016

My current work-around (finally did get it working!) is captured in nodejs/node-gyp#679 (comment)

I’m going to follow the related issues for that; hopefully documentation for node-gyp can be updated and merged

To resolve this issue, I’ll find a nice way to document the workaround in the wiki 😄

bbondy commented Apr 18, 2016

interesting finds, thanks for digging intothis @bsclifton

bsclifton commented Apr 18, 2016

Updated wiki with (hopefully) all the information folks would need to resolve this issue. Please see https://github.com/brave/browser-laptop/wiki/Troubleshooting

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

NodeJS — Error installing with NPM

I am installing a certain NodeJS script — Caress. But i am not unable to. I am using Windows 8.1, can anyone tell me what is the problem i am facing, and why is this installation not working. There seems to be a problem with the buffertools dependency, thats far as i can think. Dont know how maybe fix this?

If i download the build from github and place it in node-modules, nothing seems to work. when i try to start, using npm start, or during implementation either.

14 Answers 14

UPDATED 02/2016

Some npm plugins need node-gyp to be installed.

However, node-gyp has it’s own dependencies (from the github page):

UPDATED 09/2016

If you’re using Windows you can now install all node-gyp dependencies with single command (NOTE: Run As Admin in Windows PowerShell):

and then install the package

UPDATED 06/2018

Delete your $HOME/.node-gyp directory and try again.

See full documentation here: node-gyp

Make sure you have all the required software to run node-gyp :

You can configure version of Visual Studio used by node-gyp via an environment variable so you can avoid having to set the —msvs_version=2012 property every time you do an npm install.

  • set GYP_MSVS_VERSION=2012 for Visual Studio 2012
  • set GYP_MSVS_VERSION=2013e (the ‘e’ stands for FREE ‘express edition’)

This is still painful for Windows users of NodeJS as it assumes you have a copy of Visual Studio installed and many end users will never have this. So I’m lobbying Joyent to the encourage them to include web sockets as part of CORE node and also to possible ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem.

Feel free to add your vote at:

I encountered the issue with the error:

Here is what I was doing and what finally worked.

Disclaimer: I am just getting my hands into Node, Angular after many years in the Java, Linux world among others.

Environment Description: Windows 8.1 64-bit; Cygwin; cygwin bash shell

Command used that led to error: npm install -g karma

Error: gyp ERR! configure error gyp ERR! stack Error: Can’t find Python executable «python», you can set the PYT HON env variable.

Discovery: ‘which python’ on bash shell clearly shows ‘/usr/bin/python’. Now that is annoying!

Solution: This is only applicable to those using the environment similar to what I have, i.e. using cygwin and bash shell. Hope it helps in other environments as well but keep in mind that your kettle of tea may look a little different than mine.

  1. Firstly, need to set the $PYTHON shell env variable in .bashrc using the explicit windows path to the python executable and not the unix like root path (/usr/bin) used by cygwin.
  2. Secondly, and this one took a lot of trial/error and here’s the gotcha! Cygwin installs python under /usr/bin (which is really a mirror of /bin on windows) with the version, i.e. (in my system) /usr/bin/python2.7.exe and then adds a link /usr/bin/python —> python2.7.exe. The problem is that gyp cannot follow this link and keeps giving the annoying error that it cannot find python even though you can find it just fine from the shell command line.
  3. With the above background now add the following line to your .bashrc

export PYTHON=»C:/cygwin64/bin/python2.7.exe (or whatever is the version on your system)»

  1. Now source your .bashrc from your home directory (on cygwin)—> ‘source .bashrc’

You should be fine now and gyp will find the python executable.

I hope this helps someone stumbling on the same or similar issue.

npm install fails on windows #284

Comments

sergioharo commented Jan 28, 2015

Our current build process (on windows) is failing on version 1.9.15. The last successful build used 1.9.13. We get the following stack trace:

phantomjs@1.9.15 install d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs
node install.js

Download already available at C:\Users\tempuser\AppData\Local\Temp\phantomjs\phantomjs-1.9.8-windows.zip
Extracting zip contents
Phantom installation failed [Error: Can’t move source into dest if dest is in source.] Error: Can’t move source into dest if dest is in source.
at mv (d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\node_modules\fs-extra\lib\move.js:22:15)
at fs.move (d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\node_modules\fs-extra\lib\index.js:51:3)
at onBoundPromise (d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\node_modules\kew\kew.js:703:10)
at Object.nfcall (d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\node_modules\kew\kew.js:685:44)
at Promise._successFn (d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\install.js:341:20)
at Promise._call (d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\node_modules\kew\kew.js:373:13)
at Promise._withInput (d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\node_modules\kew\kew.js:333:25)
at Promise.resolve (d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\node_modules\kew\kew.js:105:27)
at resolver (d:\builds\jenkins\workspace\js\unit-tests\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\node_modules\kew\kew.js:409:17)
at CB (d:\builds\jenkins\workspace\js\unit-tests\node_modules\rimraf\rimraf.js:68:5)
npm ERR! phantomjs@1.9.15 install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.15 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command «C:\Program Files\nodejs\node.exe» «C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js» «install» «—loglevel» «warn»
npm ERR! cwd d:\builds\jenkins\workspace\js\unit-tests
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npmBuild step ‘Conditional steps (multiple)’ marked build as failure

Our package.json includes the following dependencies:
<
«karma»: «^0.12.1»,
«karma-jasmine»: «^0.2.2»,
«karma-requirejs»: «^0.2.1»,
«karma-phantomjs-launcher»: «^0.1.2»,
«karma-chrome-launcher»: «^0.1.3»,
«karma-coverage»: «^0.2.1»,
«karma-ng-html2js-preprocessor»: «^0.1.0»,
«karma-junit-reporter»: «^0.2.2»,
«rimraf»: «^2.2.8»
>

Adding 1.9.13 to the dependencies fixes our build

The text was updated successfully, but these errors were encountered:

Читайте также:  Пропадает значок раскладки клавиатуры windows 10
Оцените статью