Меню

Ошибка при npm install

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:Windowssystem32>npm install caress-server
npm http GET https://registry.npmjs.org/caress-server
npm http 304 https://registry.npmjs.org/caress-server
npm http GET https://registry.npmjs.org/jspack/0.0.1
npm http GET https://registry.npmjs.org/buffertools
npm http 304 https://registry.npmjs.org/jspack/0.0.1
npm http 304 https://registry.npmjs.org/buffertools

> buffertools@2.0.1 install C:Windowssystem32node_modulescaress-servernode_
modulesbuffertools
> node-gyp rebuild


C:Windowssystem32node_modulescaress-servernode_modulesbuffertools>node "G:
nodejsnode_modulesnpmbinnode-gyp-bin\....node_modulesnode-gypbinnode-
gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (G:nodejsnode_modulesnpmnode_modulesnode
-gyplibconfigure.js:101:14)
gyp ERR! stack     at G:nodejsnode_modulesnpmnode_modulesnode-gyplibconfi
gure.js:64:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "G:\nodejs\node_modules\npm\node_modules\node-gyp\
bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:Windowssystem32node_modulescaress-servernode_modulesbuffert
ools
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! buffertools@2.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the buffertools@2.0.1 install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "G:\nodejs\\node.exe" "G:\nodejs\node_modules\npm\bin\n
pm-cli.js" "install" "caress-server"
npm ERR! cwd C:Windowssystem32
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:Windowssystem32npm-debug.log
npm ERR! not ok code 0

C:Windowssystem32>

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.

G:nodejsnode_modulescaress-server>npm install

G:nodejsnode_modulescaress-server>npm start

> caress-server@0.1.1 start G:nodejsnode_modulescaress-server
> node examples/server.js

   info  - socket.io started

module.js:340
    throw err;
          ^
Error: Cannot find module './build/Release/buffertools.node'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (G:nodejsnode_modulescaress-servernode_modulesbuf
fertoolsbuffertools.js:16:19)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

npm ERR! caress-server@0.1.1 start: `node examples/server.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the caress-server@0.1.1 start script.
npm ERR! This is most likely a problem with the caress-server package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node examples/server.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls caress-server
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "G:\nodejs\\node.exe" "G:\nodejs\node_modules\npm\bin\n
pm-cli.js" "start"
npm ERR! cwd G:nodejsnode_modulescaress-server
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.24
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     G:nodejsnode_modulescaress-servernpm-debug.log
npm ERR! not ok code 0

G:nodejsnode_modulescaress-server>

asked Jan 26, 2014 at 16:00

Shaurya Chaudhuri's user avatar

2

NOTE: This is an old answer that applied to earlier versions of NodeJS. My sincere gratitude to these open source projects that responded to this issue and resolved this former pain.

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

  • https://github.com/TooTallNate/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.

Examples:

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

For the full list see

  • https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294

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:

  • https://github.com/joyent/node/issues/8005#issuecomment-50545326

answered Aug 1, 2014 at 1:49

Tony O'Hagan's user avatar

Tony O’HaganTony O’Hagan

21k3 gold badges64 silver badges73 bronze badges

1

I encountered the issue with the error:

gyp ERR! configure error

gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

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.

Preview's user avatar

Preview

34.9k10 gold badges90 silver badges112 bronze badges

answered Aug 4, 2015 at 22:23

Andy's user avatar

AndyAndy

1191 silver badge5 bronze badges

1

should be able get all node-gyp dependencies with chocolatey for Windows

choco install python2
choco install visualstudioexpress2013windowsdesktop

answered Mar 15, 2016 at 20:54

tarikakyol's user avatar

tarikakyoltarikakyol

5137 silver badges13 bronze badges

Setup JavaScript Environment

1. Install Node.js

Download installer at NodeJs website. You can download the latest V6

2. Update Npm

Npm is installed together with Node.js. So don’t worry.

3. Install Anaconda

Anaconda is the leading open data science platform powered by Python. The open source version of Anaconda is a high performance distribution of Python. It can help you to manage your python dependency. You can use it to create different python environment in the futher if you want to touch with it.

Node-gyp only support >= Python 2.7 and < Python 3.0

So just install the 2.7 version

4. Install Node-gyp

You can install with npm:


$ npm install -g node-gyp

You will also need to install:

  • On Windows:

    • Option 1: Install all the required tools and configurations using Microsoft’s windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).

    • Option 2: Install tools and configuration manually:

    • Visual C++ Build Environment:

      • Option 1: Install Visual C++ Build Tools using the Default Install option.
      • Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also works with the free Community and Express for Desktop editions.

      💡 [Windows Vista / 7 only] requires .NET Framework 4.5.1

    • Launch cmd, npm config set msvs_version 2015

    If the above steps didn’t work for you, please visit Microsoft’s Node.js Guidelines for Windows for additional tips.

If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the ‘—python’ variable:


$ node-gyp --python C:/Anaconda2/python.exe

If node-gyp is called by way of npm and you have multiple versions of Python installed, then you can set npm‘s ‘python’ config key to the appropriate value:


$ npm config set python C:/Anaconda2/python.exe

Future update for Node.js and npm

Download installer from their official website and direct install it. The installer will automatic help you to remove old files.

npm update npm

Future update for Python

conda update --all

answered Sep 22, 2016 at 9:10

YoongKang Lim's user avatar

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

This means the Python env. variable should point to the executable python file, in my case:
SET PYTHON=C:work_envPython27python.exe

answered Aug 16, 2016 at 15:07

Y. Aliaksei's user avatar

For Cygwin users:

The python issue with using npm on an out-of-the-box Cygwin installation, is that node-gyp is giving a misleading error due to incomplete checking in the ../npm/node_modules/node-gyp/lib/configure.js code.

It’s due to how Cygwin treats symbolic links. It doesn’t do that properly in an out-of-the box installation. So the error messages from the above code become misleading, as it complains about the PYTHON path and not the existence of python.exe (or link of) file itself.

There are (at least) 2 ways to resolve this.

  1. Installing the Cygwin package cygutils-extra and use winln.
  2. Use native Windows CMD in Admin mode.

For (1) you can create a proper symlink from within Cygwin shell by doing these steps:

# To make the Cygwin environment treat Windows links properly: 
# Alternatively add this to your `.bashrc` for permanent use.
export CYGWIN=winsymlinks:nativestrict

# Install Cygwin package containing "winln"
apt-cyg install cygutils-extra

# Make a proper Windows sym-link:
cd /cygdrive/c/cygwin64/bin/
winln.exe -s python2.7.exe python.exe

# Add PYTHON as a native Windows system wide variable (HKLM) 
setx /M PYTHON "C:cygwin64binpython"

(Also assuming you are running the Cygwin shell as Admin.)
Using apt-cyg is recommended and can be found in various forms on github.


For (2) the resolution for out-of-the-box Cygwin users is this:

# Open a native Windows CMD in Administrator mode and:
cd C:cygwin64bin
mklink python.exe python2.7.exe

The result should look like this:

C:cygwin64bin>ls -al python*
lrwxrwxrwx 1 xxx            xxx   13 Jun  2  2015 python -> python2.7.exe
lrwxrwxrwx 1 Administrators xxx   13 Aug 24 17:28 python.exe -> python2.7.exe
lrwxrwxrwx 1 xxx            xxx   13 Jun  2  2015 python2 -> python2.7.exe
-rwxr-xr-x 1 xxx            xxx 9235 Jun  2  2015 python2.7.exe

answered Aug 24, 2016 at 16:05

emigenix's user avatar

emigenixemigenix

1011 silver badge4 bronze badges

For windows

Check python path in system variable.
npm plugins need node-gyp to be installed.

open command prompt with admin rights, and run following command.

npm install —global —production windows-build-tools

npm install —global node-gyp

answered Nov 17, 2017 at 9:07

Mahesh Gudadari's user avatar

0

Fixed with downgrading Node from v12.8.1 to v11.15.0 and everything installed successfully

answered Aug 21, 2019 at 16:35

Mak's user avatar

MakMak

19.5k5 gold badges25 silver badges32 bronze badges

I was working on an old Vue 2.x project, at least 2 years old and deps were never updated. Reverting to Node v10.16.3 worked for me. Versions 14 and 12 did not work.

answered Jul 13, 2021 at 19:10

Aleksandar Bencun's user avatar

for me the solution was:

rm -rf  ~/.node_gyp and
sudo npm install -g node-gyp@3.4.0
cd /usr/local/lib sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib 
brew install gcc
npm install

answered Jan 4, 2017 at 8:02

Orr's user avatar

OrrOrr

4,6402 gold badges27 silver badges30 bronze badges

The question is already answered but these were not working in my case which is alpine Linux based OS so maybe this helps someone else.

I was also getting same error

gyp ERR! configure error 
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

So fix by single line just add this if you are working in Dockerfile or install it in OS

apk add --no-cache python nodejs

in ubuntu

sudo apt-get install python3.6

Note: Node version:8

answered Jan 3, 2018 at 8:54

Adiii's user avatar

AdiiiAdiii

50.9k6 gold badges132 silver badges135 bronze badges

install node-gyp and c++ compiler (gcc-c++).

answered Mar 27, 2018 at 0:24

brajesh jaishwal's user avatar

2

npm install —global —production windows-build-tools

answered Feb 25, 2021 at 19:13

Elialber Lopes's user avatar

I am trying to globally install an npm module I just published. Every time I try to install, either from npm or the folder, I get this error.

npm ERR! Error: ENOENT, chmod '/usr/local/lib/node_modules/takeapeek/lib/cmd.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.8.0-19-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "takeapeek"
npm ERR! cwd /home/giodamlio
npm ERR! node -v v0.10.6
npm ERR! npm -v 1.3.6
npm ERR! path /usr/local/lib/node_modules/takeapeek/lib/cmd.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/giodamlio/npm-debug.log
npm ERR! not ok code 0

I am using sudo and I have triple checked everything in the package everything should work. I did some searching around, and saw a couple of similer cases none of which have been resolved. Here is what I tried.

  • Upgrade npm (sudo npm install -g npm)
  • Clear the global npm cache (sudo npm cache clear)
  • Clear the user npm cache (npm cache clear)

I noticed that the error had to do with the file I am linking to the path, specifically when npm tried to do a chmod. That shouldn’t be a problem, my lib/cli.js has normal permissions, and npm has superuser permissions during this install.

After digging through the npm docs I found an option that would stop npm from making the bin links(--no-bin-links), when I tried the install with it, it worked fine.

So what’s the deal? Is this some weird fringe case bug that has no solution yet?

Edit: For reference, here is the module I uploaded

mikemaccana's user avatar

mikemaccana

103k93 gold badges371 silver badges469 bronze badges

asked Aug 1, 2013 at 9:49

giodamelio's user avatar

9

Ok it looks like NPM is using your .gitignore as a base for the .npmignore file, and thus ignores /lib. If you add a blank .npmignore file into the root of your application, everything should work.

A better, more explicit approach is to use an allow-list rather than a disallow-list, and use the «files» field in package.json to specify the files in your package.

[edit] — more info on this behaviour here: https://docs.npmjs.com/cli/v7/using-npm/developers#keeping-files-out-of-your-package

answered Aug 2, 2013 at 15:03

badsyntax's user avatar

badsyntaxbadsyntax

9,2553 gold badges45 silver badges65 bronze badges

10

I ran into a similar problem,

npm cache clean

solved it.

Uri Agassi's user avatar

Uri Agassi

36.5k13 gold badges76 silver badges93 bronze badges

answered May 3, 2014 at 15:06

Genjuro's user avatar

GenjuroGenjuro

7,2657 gold badges39 silver badges61 bronze badges

2

This problem somehow arose for me on Mac when I was trying to run npm install -g bower. It was giving me a number of errors for not being able to find things like graceful-fs. I’m not sure how I installed npm originally, but it looks like perhaps it came down with node using homebrew. I first ran

brew uninstall node

This removed both node and npm from my path. From there I just reinstalled it

brew install node

When it completed I had node and npm on my path and I was able to run

rm -rf ~/.npm
npm install -g bower

This then installed bower successfully.

Updating the brew formulas and upgrading the installs didn’t seem to work for me, I’m not sure why. The removal of the .npm folder was something that had worked for other people, and I had tried it without success. I did it this time just in case. Note also that neither of the following solved the problem for me, although it did for others:

npm cache clean
sudo npm cache clean

answered Jan 9, 2014 at 23:52

user1978019's user avatar

user1978019user1978019

2,8081 gold badge28 silver badges37 bronze badges

0

I encountered similar behavior after upgrading to npm 6.1.0. It seemed to work once, but then I got into a state with this error while trying to install a package that was specified by path on the filesystem:

npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

The following things did not fix the problem:

  • rm -rf node_modules
  • npm cache clean (gave npm ERR! As of npm@5, the npm cache self-heals….use 'npm cache verify' instead.)
  • npm cache verify
  • rm -rf ~/.npm

How I fixed the problem:

  • rm package-lock.json

answered Jul 12, 2018 at 12:50

Ian's user avatar

IanIan

10.8k2 gold badges35 silver badges57 bronze badges

I was getting this error on npm install and adding .npmignore did not solve it.

Error: ENOENT, stat ‘C:UsersMy-UserNameAppDataRoamingnpm’

I tried going to the mentioned folder and it did not exist.
The error was fixed when I created npm folder in Roaming folder.

This is on Windows 8.1

answered Nov 15, 2014 at 23:08

Vijay Vepakomma's user avatar

I had the same problem, and just found a handling not mentioned here. Though I’d contribute to the community:

npm install -g myapp was not copying the bin directory. I found this to be because I did not include it in the files in my package.json

"files": [
  "lib",
  "bin" // this was missing
]

answered Jun 11, 2015 at 0:26

dthree's user avatar

dthreedthree

19.2k14 gold badges75 silver badges105 bronze badges

3

Delete package-lock.json file then run npm install

answered Apr 13, 2021 at 6:00

Clark's user avatar

ClarkClark

1391 silver badge11 bronze badges

I was getting a similar error on npm install on a local installation:

npm ERR! enoent ENOENT: no such file or directory, stat '[path/to/local/installation]/node_modules/grunt-contrib-jst'

I am not sure what was causing the error, but I had recently installed a couple of new node modules locally, upgraded node with homebrew, and ran ‘npm update -g’.

The only way I was able to resolve the issue was to delete the local node_modules directory entirely and run npm install again:

cd [path/to/local/installation]
npm rm -rdf node_modules
npm install

answered Dec 31, 2015 at 0:40

g.carey's user avatar

g.careyg.carey

6807 silver badges6 bronze badges

I have a similar problem specifucally :
ERR! enoent ENOENT: no such file or directory, chmod ‘node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv
I tried all above solutions but no luck.
I was using vagrant box, and the project was in a shared folder. The problems seems to be only there, when I move the project to another not shared folder (woth host), voila! problem solved.
Just in case another person was using also vagrant

answered Mar 2, 2017 at 21:05

joaco1977's user avatar

1

I got the simple solution, just clear the npm cache.

sudo npm cache clear --force

then remove the node_modules & package-lock.json

sudo rm -rf node_modules
sudo rm -rf package-lock.json

Now install the dependencies module using npm and start the server

npm install && npm start

answered Jul 17, 2021 at 2:38

Abhishek Patel's user avatar

I got a similar error message when trying to npm install a bunch of dependencies. Turns out some of them fail to install on Debian/Ubuntu because they expect /usr/bin/node to be the node executable. To fix, you need do

sudo ln -s nodejs /usr/bin/node 

or better yet,

sudo apt-get install nodejs-legacy

For more info: https://stackoverflow.com/a/21171188/7581

Community's user avatar

answered Feb 19, 2015 at 6:26

itsadok's user avatar

itsadokitsadok

28.5k29 gold badges124 silver badges170 bronze badges

I got this error while trying to install a grunt plugin. i found i had an outdated version of npm and the error went away after updating npm to the latest version

npm install -g npm

answered Apr 4, 2015 at 16:13

Prabhu Murthy's user avatar

Prabhu MurthyPrabhu Murthy

8,9615 gold badges28 silver badges36 bronze badges

I think your compiled coffee script is missing from the published npm package. Try writing a prepublish command.

answered Aug 1, 2013 at 23:34

leeway's user avatar

leewayleeway

4751 gold badge3 silver badges8 bronze badges

2

In my case (multiple code ENOENT errno 34) problem was with ~/.npm/ directory access. Inside it there were some subdirs having root:root rights, which were causing problems while I run commands as normal user (without sudo). So I changed ownership of all subdirs and files inside ~/.npm/ dir into my local user and group. That did the trick on my Ubuntu (on Mac should work too).

$ sudo chown yourusername.yourgroupname ~/.npm/ -R

You should know your user name, right? If no then run $ whoami and substitute your group name with it too, like this:

$ sudo chown johnb.johnb ~/.npm/ -R

EDIT:

Test case:

From my local account /home/johnb I npm-installed globally some generator for yeoman, like this:

$ sudo npm install -g generator-laravel

Problem nature:

Above action caused some dependencies being installed inside ~/.npm/ dir, having root:root ownership (because of sudo ...). Evidently npm does not run as local user (or change dependencies subdirs ownership afterwards) when pulling dependencies and writing them to a local user subdir ~/.npm/.
As long as npm would be so careless against fundamental unix filesystem security issues the problem would reoccur.

Solution:

  1. Continuosly check if ~/.npm/ contains subdirs with ownership (and/or permissions) other than your local user account, especially when you install or update something with sodo (root). If so, change the ownership inside ~/.npm/ to a local user recursively.

  2. Ask npm, bower, grunt, ... community that they address this issue as I described it above.

answered May 28, 2014 at 22:10

paperclip's user avatar

Had a similar Issue but I was in wrong directory please cross check the path of thee file & the run npm start

answered May 2, 2022 at 3:01

Omkar Bhavare's user avatar

1

I tried all the stuff I found on the net (npm cache clear and rm -rf ~/.npm), but nothing seems to work. What solved the issue was updating node (and npm) to the latest version. Try that.

answered May 24, 2014 at 16:49

Nikola M.'s user avatar

Nikola M.Nikola M.

5736 silver badges16 bronze badges

In Windows I had a similar error.
Search paste App Data and search for the string npm.

I replaced the string 'npm' (including quotes) with 'npm.cmd' in both atlasboardlibpackage-dependency-manager.js and atlasboardlibclicommands.js. That fixed the problem.

Bob Gilmore's user avatar

Bob Gilmore

11.9k13 gold badges50 silver badges53 bronze badges

answered Oct 27, 2014 at 17:20

Vinicius Carvalho's user avatar

The same error during global install (npm install -g mymodule) for package with a non-existing script.

In package.json:

    ...
    "bin": {
      "module": "./bin/module"
    },
    ...

But the ./bin/module did not exist, as it was named modulejs.

answered Nov 3, 2014 at 12:40

hg.'s user avatar

hg.hg.

3241 silver badge13 bronze badges

0

  1. Install latest version of node
  2. Run: npm cache clean
  3. Run: npm install cordova -g

answered Jan 10, 2017 at 3:29

Dilhan Jayathilake's user avatar

You can get this error if your node.js is corrupted somehow as well. I fixed this error by uninstall/restart/install node.js completely and it fixed this error, along with the three other mysterious errors that are thrown.

answered May 26, 2018 at 4:04

Be careful with invalid values for keys «directories» and «files» in package.json

If you start with a new application, and you want to start completely blank, you have to
either start in a complete empty folder or have a valid package.json file in it.

If you do not want to create a package.json file first, just type: npm i some_package

Package with name «some_package» should be installed correctly in a new sub folder «node_modules».

If you create a package.json file first, type: npm init
Keep all the defaults (by just clicking ENTER), you should end up with a valid file.

It should look like this:

{
  "name": "yourfoldername",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo "Error: no test specified" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

Note that the following keys are missing: «directories«, «repository» and «files«. It looks like if you use incorrect values for «directories» and/or «files«, you are not able to install the package. Leaving these keys out, solved the issue for me.

Also note key «main«. This one is present, but it does contain an invalid value. No file «index.js» exists (yet). You can safely remove it.

Now type: npm i some_package
and package with name «some_package» should be installed correctly in a new sub folder «node_modules».

answered Oct 16, 2018 at 13:16

RWC's user avatar

RWCRWC

4,4292 gold badges20 silver badges26 bronze badges

Had a similar error with npm in a docker container for webpack. The issue was caused by the —user command line argument of docker run, because the given user and group in there somehow messed up the rights on the local volume. Hope this helps someone 🙂

answered Mar 16, 2020 at 21:28

Hajo's user avatar

HajoHajo

8596 silver badges21 bronze badges

Tried nearly everything then finally this:

Simply remove node_modules then run 'npm install' again

answered May 3, 2020 at 15:08

Alex Stephens's user avatar

Alex StephensAlex Stephens

2,9071 gold badge35 silver badges41 bronze badges

I had the same problem on ubuntu, and got rid of the problem by closing the terminal and opening a new one.

answered Mar 3, 2021 at 11:50

abass.mahdavi's user avatar

1

It’s because there is no package.json and only package-lock.json

Try: npm init —yes

answered Jul 3, 2021 at 18:14

Rachel's user avatar

RachelRachel

892 silver badges8 bronze badges

I had a similar issue with a different cause: the yo node generator had added "files": ["lib/"] to my package.json and because my cli.js was outside of the lib/ directory, it was getting skipped when publishing to npm.

(Yeoman issue at https://github.com/yeoman/generator-node/issues/63 it should be fixed soon.)

answered Nov 6, 2014 at 16:51

Nathan Friedly's user avatar

Nathan FriedlyNathan Friedly

7,7693 gold badges39 silver badges59 bronze badges

I was getting the error «Error: ENOENT, stat ‘C:UsersuserNameAppDataRoamingnpm’. But there was no such directory. Created the directory and the npm install started working

answered Jan 29, 2015 at 2:39

k.iyengar's user avatar

I recently upgraded to node 4.2.1 on a Windows 7 x64 machine. When running

npm install -g bower

I got a similar error:

npm ERR! enoent ENOENT: no such file or directory, open ‘C:UsersTHE_USERNAMEAppDataLocalTempnpm-THE_HASH’

Thinking it was related to the AppData path, I played around with

npm config edit

and

npm config edit --global

to change the prefix, cache and tmp fields but received the same error with the new paths:

npm ERR! enoent ENOENT: no such file or directory, open ‘C:UsersTHE_USERNAMEnpm-tempnpm-THE_HASH’

All commands were run as Administrator, so I had full permissions.

Then I thought there were some issues with existing files so I ran:

npm cache clean

But got the same error. However, there were still some temp files lying around. Manually removing all temp data with cygwin finally fixed the problem for me:

rm -rf bower bower.cmd node_modules etc

If you only have Windows cmd, you could use something like

rmdir /S THE_TEMP_DIR

to remove all subdirectories (although if you have deeply nested node dependencies, this is notoriously problematic)

So, maybe there is some issues with upgrading npm and having versions of bower or other packages hanging around. In my case that seemed to be the problem

answered Oct 30, 2015 at 16:45

Andrew Johnston's user avatar

While installing ionic I got below error

115648 error enoent ENOENT: no such file or directory, rename
‘C:UsersUserNameAppDataRoamingnpmnode_modules.stagingansi-b11f0c4b’
-> ‘C:UsersUserNameAppDataRoamingnpmnode_modulesionicnode_modulescordova-libnode_modulesansi’

There was no folder called ansi at that path. I created it there and it installed correctly.

devlin carnate's user avatar

answered Jan 6, 2017 at 17:50

Vijay Mishra's user avatar

0

If you tried to «make install» in your project directory with this error you can try it:

rm -rf ./node_modules
npm cache clear
npm remove sails

then you can try to «make install»

If you have the «npm ERR! enoent ENOENT: no such file or directory, chmod ‘…/djam-backend/node_modules/js-beautify/js/bin/css-beautify.js'» then you can try to install some previous version of the js-beautify, more comments: https://github.com/beautify-web/js-beautify/issues/1247

"dependencies": {
  ...
  "js-beautify": "1.6.14"
  ...
}

and the run «make install». It seem works in case if you have not other dependencies that requires higher version (1.7.0) in this case you must downgrade this packages also in the packages.json.

or

answered Sep 18, 2017 at 10:29

Alex's user avatar

AlexAlex

1,2571 gold badge15 silver badges12 bronze badges

I am trying to globally install an npm module I just published. Every time I try to install, either from npm or the folder, I get this error.

npm ERR! Error: ENOENT, chmod '/usr/local/lib/node_modules/takeapeek/lib/cmd.js'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.8.0-19-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "takeapeek"
npm ERR! cwd /home/giodamlio
npm ERR! node -v v0.10.6
npm ERR! npm -v 1.3.6
npm ERR! path /usr/local/lib/node_modules/takeapeek/lib/cmd.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/giodamlio/npm-debug.log
npm ERR! not ok code 0

I am using sudo and I have triple checked everything in the package everything should work. I did some searching around, and saw a couple of similer cases none of which have been resolved. Here is what I tried.

  • Upgrade npm (sudo npm install -g npm)
  • Clear the global npm cache (sudo npm cache clear)
  • Clear the user npm cache (npm cache clear)

I noticed that the error had to do with the file I am linking to the path, specifically when npm tried to do a chmod. That shouldn’t be a problem, my lib/cli.js has normal permissions, and npm has superuser permissions during this install.

After digging through the npm docs I found an option that would stop npm from making the bin links(--no-bin-links), when I tried the install with it, it worked fine.

So what’s the deal? Is this some weird fringe case bug that has no solution yet?

Edit: For reference, here is the module I uploaded

mikemaccana's user avatar

mikemaccana

103k93 gold badges371 silver badges469 bronze badges

asked Aug 1, 2013 at 9:49

giodamelio's user avatar

9

Ok it looks like NPM is using your .gitignore as a base for the .npmignore file, and thus ignores /lib. If you add a blank .npmignore file into the root of your application, everything should work.

A better, more explicit approach is to use an allow-list rather than a disallow-list, and use the «files» field in package.json to specify the files in your package.

[edit] — more info on this behaviour here: https://docs.npmjs.com/cli/v7/using-npm/developers#keeping-files-out-of-your-package

answered Aug 2, 2013 at 15:03

badsyntax's user avatar

badsyntaxbadsyntax

9,2553 gold badges45 silver badges65 bronze badges

10

I ran into a similar problem,

npm cache clean

solved it.

Uri Agassi's user avatar

Uri Agassi

36.5k13 gold badges76 silver badges93 bronze badges

answered May 3, 2014 at 15:06

Genjuro's user avatar

GenjuroGenjuro

7,2657 gold badges39 silver badges61 bronze badges

2

This problem somehow arose for me on Mac when I was trying to run npm install -g bower. It was giving me a number of errors for not being able to find things like graceful-fs. I’m not sure how I installed npm originally, but it looks like perhaps it came down with node using homebrew. I first ran

brew uninstall node

This removed both node and npm from my path. From there I just reinstalled it

brew install node

When it completed I had node and npm on my path and I was able to run

rm -rf ~/.npm
npm install -g bower

This then installed bower successfully.

Updating the brew formulas and upgrading the installs didn’t seem to work for me, I’m not sure why. The removal of the .npm folder was something that had worked for other people, and I had tried it without success. I did it this time just in case. Note also that neither of the following solved the problem for me, although it did for others:

npm cache clean
sudo npm cache clean

answered Jan 9, 2014 at 23:52

user1978019's user avatar

user1978019user1978019

2,8081 gold badge28 silver badges37 bronze badges

0

I encountered similar behavior after upgrading to npm 6.1.0. It seemed to work once, but then I got into a state with this error while trying to install a package that was specified by path on the filesystem:

npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

The following things did not fix the problem:

  • rm -rf node_modules
  • npm cache clean (gave npm ERR! As of npm@5, the npm cache self-heals….use 'npm cache verify' instead.)
  • npm cache verify
  • rm -rf ~/.npm

How I fixed the problem:

  • rm package-lock.json

answered Jul 12, 2018 at 12:50

Ian's user avatar

IanIan

10.8k2 gold badges35 silver badges57 bronze badges

I was getting this error on npm install and adding .npmignore did not solve it.

Error: ENOENT, stat ‘C:UsersMy-UserNameAppDataRoamingnpm’

I tried going to the mentioned folder and it did not exist.
The error was fixed when I created npm folder in Roaming folder.

This is on Windows 8.1

answered Nov 15, 2014 at 23:08

Vijay Vepakomma's user avatar

I had the same problem, and just found a handling not mentioned here. Though I’d contribute to the community:

npm install -g myapp was not copying the bin directory. I found this to be because I did not include it in the files in my package.json

"files": [
  "lib",
  "bin" // this was missing
]

answered Jun 11, 2015 at 0:26

dthree's user avatar

dthreedthree

19.2k14 gold badges75 silver badges105 bronze badges

3

Delete package-lock.json file then run npm install

answered Apr 13, 2021 at 6:00

Clark's user avatar

ClarkClark

1391 silver badge11 bronze badges

I was getting a similar error on npm install on a local installation:

npm ERR! enoent ENOENT: no such file or directory, stat '[path/to/local/installation]/node_modules/grunt-contrib-jst'

I am not sure what was causing the error, but I had recently installed a couple of new node modules locally, upgraded node with homebrew, and ran ‘npm update -g’.

The only way I was able to resolve the issue was to delete the local node_modules directory entirely and run npm install again:

cd [path/to/local/installation]
npm rm -rdf node_modules
npm install

answered Dec 31, 2015 at 0:40

g.carey's user avatar

g.careyg.carey

6807 silver badges6 bronze badges

I have a similar problem specifucally :
ERR! enoent ENOENT: no such file or directory, chmod ‘node_modules/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv
I tried all above solutions but no luck.
I was using vagrant box, and the project was in a shared folder. The problems seems to be only there, when I move the project to another not shared folder (woth host), voila! problem solved.
Just in case another person was using also vagrant

answered Mar 2, 2017 at 21:05

joaco1977's user avatar

1

I got the simple solution, just clear the npm cache.

sudo npm cache clear --force

then remove the node_modules & package-lock.json

sudo rm -rf node_modules
sudo rm -rf package-lock.json

Now install the dependencies module using npm and start the server

npm install && npm start

answered Jul 17, 2021 at 2:38

Abhishek Patel's user avatar

I got a similar error message when trying to npm install a bunch of dependencies. Turns out some of them fail to install on Debian/Ubuntu because they expect /usr/bin/node to be the node executable. To fix, you need do

sudo ln -s nodejs /usr/bin/node 

or better yet,

sudo apt-get install nodejs-legacy

For more info: https://stackoverflow.com/a/21171188/7581

Community's user avatar

answered Feb 19, 2015 at 6:26

itsadok's user avatar

itsadokitsadok

28.5k29 gold badges124 silver badges170 bronze badges

I got this error while trying to install a grunt plugin. i found i had an outdated version of npm and the error went away after updating npm to the latest version

npm install -g npm

answered Apr 4, 2015 at 16:13

Prabhu Murthy's user avatar

Prabhu MurthyPrabhu Murthy

8,9615 gold badges28 silver badges36 bronze badges

I think your compiled coffee script is missing from the published npm package. Try writing a prepublish command.

answered Aug 1, 2013 at 23:34

leeway's user avatar

leewayleeway

4751 gold badge3 silver badges8 bronze badges

2

In my case (multiple code ENOENT errno 34) problem was with ~/.npm/ directory access. Inside it there were some subdirs having root:root rights, which were causing problems while I run commands as normal user (without sudo). So I changed ownership of all subdirs and files inside ~/.npm/ dir into my local user and group. That did the trick on my Ubuntu (on Mac should work too).

$ sudo chown yourusername.yourgroupname ~/.npm/ -R

You should know your user name, right? If no then run $ whoami and substitute your group name with it too, like this:

$ sudo chown johnb.johnb ~/.npm/ -R

EDIT:

Test case:

From my local account /home/johnb I npm-installed globally some generator for yeoman, like this:

$ sudo npm install -g generator-laravel

Problem nature:

Above action caused some dependencies being installed inside ~/.npm/ dir, having root:root ownership (because of sudo ...). Evidently npm does not run as local user (or change dependencies subdirs ownership afterwards) when pulling dependencies and writing them to a local user subdir ~/.npm/.
As long as npm would be so careless against fundamental unix filesystem security issues the problem would reoccur.

Solution:

  1. Continuosly check if ~/.npm/ contains subdirs with ownership (and/or permissions) other than your local user account, especially when you install or update something with sodo (root). If so, change the ownership inside ~/.npm/ to a local user recursively.

  2. Ask npm, bower, grunt, ... community that they address this issue as I described it above.

answered May 28, 2014 at 22:10

paperclip's user avatar

Had a similar Issue but I was in wrong directory please cross check the path of thee file & the run npm start

answered May 2, 2022 at 3:01

Omkar Bhavare's user avatar

1

I tried all the stuff I found on the net (npm cache clear and rm -rf ~/.npm), but nothing seems to work. What solved the issue was updating node (and npm) to the latest version. Try that.

answered May 24, 2014 at 16:49

Nikola M.'s user avatar

Nikola M.Nikola M.

5736 silver badges16 bronze badges

In Windows I had a similar error.
Search paste App Data and search for the string npm.

I replaced the string 'npm' (including quotes) with 'npm.cmd' in both atlasboardlibpackage-dependency-manager.js and atlasboardlibclicommands.js. That fixed the problem.

Bob Gilmore's user avatar

Bob Gilmore

11.9k13 gold badges50 silver badges53 bronze badges

answered Oct 27, 2014 at 17:20

Vinicius Carvalho's user avatar

The same error during global install (npm install -g mymodule) for package with a non-existing script.

In package.json:

    ...
    "bin": {
      "module": "./bin/module"
    },
    ...

But the ./bin/module did not exist, as it was named modulejs.

answered Nov 3, 2014 at 12:40

hg.'s user avatar

hg.hg.

3241 silver badge13 bronze badges

0

  1. Install latest version of node
  2. Run: npm cache clean
  3. Run: npm install cordova -g

answered Jan 10, 2017 at 3:29

Dilhan Jayathilake's user avatar

You can get this error if your node.js is corrupted somehow as well. I fixed this error by uninstall/restart/install node.js completely and it fixed this error, along with the three other mysterious errors that are thrown.

answered May 26, 2018 at 4:04

Be careful with invalid values for keys «directories» and «files» in package.json

If you start with a new application, and you want to start completely blank, you have to
either start in a complete empty folder or have a valid package.json file in it.

If you do not want to create a package.json file first, just type: npm i some_package

Package with name «some_package» should be installed correctly in a new sub folder «node_modules».

If you create a package.json file first, type: npm init
Keep all the defaults (by just clicking ENTER), you should end up with a valid file.

It should look like this:

{
  "name": "yourfoldername",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo "Error: no test specified" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

Note that the following keys are missing: «directories«, «repository» and «files«. It looks like if you use incorrect values for «directories» and/or «files«, you are not able to install the package. Leaving these keys out, solved the issue for me.

Also note key «main«. This one is present, but it does contain an invalid value. No file «index.js» exists (yet). You can safely remove it.

Now type: npm i some_package
and package with name «some_package» should be installed correctly in a new sub folder «node_modules».

answered Oct 16, 2018 at 13:16

RWC's user avatar

RWCRWC

4,4292 gold badges20 silver badges26 bronze badges

Had a similar error with npm in a docker container for webpack. The issue was caused by the —user command line argument of docker run, because the given user and group in there somehow messed up the rights on the local volume. Hope this helps someone 🙂

answered Mar 16, 2020 at 21:28

Hajo's user avatar

HajoHajo

8596 silver badges21 bronze badges

Tried nearly everything then finally this:

Simply remove node_modules then run 'npm install' again

answered May 3, 2020 at 15:08

Alex Stephens's user avatar

Alex StephensAlex Stephens

2,9071 gold badge35 silver badges41 bronze badges

I had the same problem on ubuntu, and got rid of the problem by closing the terminal and opening a new one.

answered Mar 3, 2021 at 11:50

abass.mahdavi's user avatar

1

It’s because there is no package.json and only package-lock.json

Try: npm init —yes

answered Jul 3, 2021 at 18:14

Rachel's user avatar

RachelRachel

892 silver badges8 bronze badges

I had a similar issue with a different cause: the yo node generator had added "files": ["lib/"] to my package.json and because my cli.js was outside of the lib/ directory, it was getting skipped when publishing to npm.

(Yeoman issue at https://github.com/yeoman/generator-node/issues/63 it should be fixed soon.)

answered Nov 6, 2014 at 16:51

Nathan Friedly's user avatar

Nathan FriedlyNathan Friedly

7,7693 gold badges39 silver badges59 bronze badges

I was getting the error «Error: ENOENT, stat ‘C:UsersuserNameAppDataRoamingnpm’. But there was no such directory. Created the directory and the npm install started working

answered Jan 29, 2015 at 2:39

k.iyengar's user avatar

I recently upgraded to node 4.2.1 on a Windows 7 x64 machine. When running

npm install -g bower

I got a similar error:

npm ERR! enoent ENOENT: no such file or directory, open ‘C:UsersTHE_USERNAMEAppDataLocalTempnpm-THE_HASH’

Thinking it was related to the AppData path, I played around with

npm config edit

and

npm config edit --global

to change the prefix, cache and tmp fields but received the same error with the new paths:

npm ERR! enoent ENOENT: no such file or directory, open ‘C:UsersTHE_USERNAMEnpm-tempnpm-THE_HASH’

All commands were run as Administrator, so I had full permissions.

Then I thought there were some issues with existing files so I ran:

npm cache clean

But got the same error. However, there were still some temp files lying around. Manually removing all temp data with cygwin finally fixed the problem for me:

rm -rf bower bower.cmd node_modules etc

If you only have Windows cmd, you could use something like

rmdir /S THE_TEMP_DIR

to remove all subdirectories (although if you have deeply nested node dependencies, this is notoriously problematic)

So, maybe there is some issues with upgrading npm and having versions of bower or other packages hanging around. In my case that seemed to be the problem

answered Oct 30, 2015 at 16:45

Andrew Johnston's user avatar

While installing ionic I got below error

115648 error enoent ENOENT: no such file or directory, rename
‘C:UsersUserNameAppDataRoamingnpmnode_modules.stagingansi-b11f0c4b’
-> ‘C:UsersUserNameAppDataRoamingnpmnode_modulesionicnode_modulescordova-libnode_modulesansi’

There was no folder called ansi at that path. I created it there and it installed correctly.

devlin carnate's user avatar

answered Jan 6, 2017 at 17:50

Vijay Mishra's user avatar

0

If you tried to «make install» in your project directory with this error you can try it:

rm -rf ./node_modules
npm cache clear
npm remove sails

then you can try to «make install»

If you have the «npm ERR! enoent ENOENT: no such file or directory, chmod ‘…/djam-backend/node_modules/js-beautify/js/bin/css-beautify.js'» then you can try to install some previous version of the js-beautify, more comments: https://github.com/beautify-web/js-beautify/issues/1247

"dependencies": {
  ...
  "js-beautify": "1.6.14"
  ...
}

and the run «make install». It seem works in case if you have not other dependencies that requires higher version (1.7.0) in this case you must downgrade this packages also in the packages.json.

or

answered Sep 18, 2017 at 10:29

Alex's user avatar

AlexAlex

1,2571 gold badge15 silver badges12 bronze badges


Photo from Unsplash

The npm install command is used for installing JavaScript packages on your local computer.

When developing web projects, you may see issues that cause the npm install command to fail.

You need to see the error message generated in the terminal for clues to resolve the error.

Some of the most common issues for npm install not working are as follows:

  • npm command not found
  • No package.json file describing the dependencies
  • Integrity check failed error
  • For Windows: Python not found

Let’s see how you can resolve these errors next.

The npm command not found error

To run the npm install command, you need to have npm installed on your computer

$ npm install
sh: command not found: npm

The error above happens when npm can’t be found under the PATH environment variable.

First, you need to make sure that npm is installed on your computer.

npm is bundled with Node.js server, which you can download from the nodejs.org website.

Once you downloaded and installed Node.js, open the terminal and run the npm -v command.

You should see the version of npm installed on your computer as follows:

Once you see the npm version, you should be able to run the npm install command again.

For more details, visit the fixing npm command not found error article I’ve written previously.

ENOENT: No package.json file

The npm install command looks for a package.json file in order to find the packages it needs to install.

You need to make sure you have a package.json file right in the current directory where you run the command.

You can run the ls -1 command as follows:

$ ls -1
index.js
package-lock.json
package.json

Once you see there’s a package.json file in the output as shown above, then you can run the npm install command.

For this reason, you should always run the npm install command from the root directory of your project.

By the way, npm install will install packages already listed under the dependencies object of your package.json file.

Suppose you have a package.json file as shown below:

{
  "name": "n-app",
  "version": "1.0.0",
  "description": "A Node application",
  "dependencies": {
    "jest": "^28.1.1",
    "typescript": "^4.5.5",
    "webpack": "^2.7.0"
  }
}

Then npm install will install jest, typescript, and webpack to the generated node_modules/ folder.

If you need to install a new package, then you need to specify the name like these examples:

# 👇 install react package
npm install react

# 👇 install react, react-dom, and axios packages
npm install react react-dom axios

You can install one or many packages with the npm install command.

Integrity check failed error

When you have a package-lock.json file in your project, then npm will check the integrity of the package you downloaded with the one specified in the lock file.

When the checksum of the package is different, then npm will stop the installation and throw the integrity check failed error.

The following is an example of the error:

npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting @my-package@^1.2.0:
npm ERR! Verification failed while extracting @my-package@^1.2.0:
npm ERR! Integrity check failed:

npm ERR! Wanted: sha512-lQ...HA== 
npm ERR! Found:  sha512-Mj...vg==

When this happens, you can fix the issue by verifying the cache:

When the command is finished, run npm install again.

If you still see the error, then delete your lock file and clean the npm cache.

Run the following commands from your project’s root directory:

# 👇 remove the lock file
rm package-lock.json

# 👇 remove the node_modules folder
rm -rf node_modules

# 👇 Clear the npm cache
npm cache clean --force

# 👇 run npm install again
npm install

That should fix the issue with the integrity check.

For Windows only: Python not found

When running npm install on Windows, you may see an error that says Can’t find Python executable as shown below:

> node-gyp rebuild

/n-app>node "..node_modulesnode-gypbinnode-gyp.js" rebuild
npm http 304 https://registry.npmjs.org/bcrypt
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python",
you can set the PYTHON env variable.

The node-gyp module is a Node.js tool for compiling native modules written in C and C++. It requires Python to run properly.

Instead of installing Python by yourself, you can install the Windows Build Tools which has Python included.

This is because Windows also requires Visual Studio build tools to make node-gyp run successfully.

If you install only Python, then you may find that you need the build tools later.

Please note that the latest version of Node.js for Windows installer already includes the build tools by default.

But if you can’t update your Node.js version yet, then installing the build tools manually should help you fix this error.

Conclusion

The npm install command may fail to work because of many reasons.

When the command doesn’t work, you need to check the output first and see what specific error you have.

Try a Google search to fix the issue. When you don’t see a solution, try posting a new question at Stack Overflow mentioning the things you have tried to fix the issue.

Good luck resolving the issue! 👍

Необходимо определиться с версией, которая вам нужна. Я предпочитаю ставить не новейшую версию Node.js, а последнюю LTS.

Установка в Elementary OS, Ubuntu:

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

Установка в Debian:

curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt-get install -y nodejs

Инструкции под разные системы и для разных версий от разработчиков.

Проверка версий:

nodejs -v
npm -v

Если для проекта вы делаете:

npm install

И вылезает ошибка, вроде:

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/.../node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:311:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-42-generic
gyp ERR! command "/usr/bin/node" "/home/.../node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/.../node_modules/node-sass
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.10.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.10.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/d1mon/.npm/_logs/2020-03-31T05_52_52_174Z-debug.log

Необходимо удалить каталог node_modules и файл блокировки package-lock.json, очистить кэш и пробовать заново:

rm -rf node_modules package-lock.json
npm cache clean --force
npm install

Глобальная установка пакетов

Для глобальной установки пакетов в команду добавляется параметр -g. Но это не будет работать по умолчанию из-за проблем с правами доступа, поэтому предварительно требуется сделать следующее.

Создадим каталог для глобальных установок:

mkdir ~/.npm-global

Настройка npm на использование нового каталога:

npm config set prefix '~/.npm-global'

В файл ~/.profile необходимо добавить строку:

export PATH=~/.npm-global/bin:$PATH

В командной строке снова, для применения изменений:

source ~/.profile

На этом все, теперь можно устанавливать пакеты глобально.

Содержание

  1. Common errors
  2. AppDataRoamingnpm’ on Windows 7 permalink» >
  3. Распространённые ошибки при использовании npm, которых лучше не совершать
  4. 1. Ручное добавление зависимостей в файл package.json
  5. 2. Ограничение зависимостей типа peerDependencies конкретной версией патча
  6. 3. Публикация нескольких модулей в виде единственного пакета
  7. 4. Случайная публикация секретных данных
  8. 5. Использование обычного токена аутентификации
  9. 6. Бессмысленное обновление пакетов
  10. 7. Удаление файла package-lock.json
  11. Итоги
  12. Common errors
  13. Errors
  14. Сломанная установка npm
  15. Random errors
  16. Не найдена совместимая версия
  17. Permissions errors
  18. Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ on Windows 7″ onmousemove=»i18n(this)»> Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ в Windows 7
  19. No space
  20. No git
  21. Запуск блока Vagrant на Windows не удается из-за проблем с длиной пути
  22. git: and ssh+git: URLs for GitHub repos, breaking proxies» onmousemove=»i18n(this)»>npm использует только git: и ssh+git: URL-адреса для репозиториев GitHub, нарушая прокси
  23. SSL Error
  24. SSL-intercepting proxy
  25. Не найдено/Ошибка сервера
  26. Invalid JSON
  27. ENOENT / ENOTEMPTY errors in output» onmousemove=»i18n(this)»>Многие ошибки ENOENT / ENOTEMPTY в выводе
  28. cb() never called! when using shrinkwrapped dependencies» onmousemove=»i18n(this)»> cb() never called! при использовании термоусадочных зависимостей
  29. npm login errors» onmousemove=»i18n(this)»> npm login ошибки входа в npm
  30. npm hangs on Windows at addRemoteTarball » onmousemove=»i18n(this)»> npm зависает в Windows на addRemoteTarball

Common errors

Broken npm installation

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).
  • Some strange issues can be resolved by simply running npm cache clean and trying again.
  • If you are having trouble with npm install , use the -verbose option to see more details.

No compatible version found

AppDataRoamingnpm’ on Windows 7 permalink» >

Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ on Windows 7

The error Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ on Windows 7 is a consequence of joyent/node#8141, and is an issue with the Node installer for Windows. The workaround is to ensure that C:Users AppDataRoamingnpm exists and is writable with your normal user account.

You are trying to install on a drive that either has no space, or has no permission to write.

  • Free some disk space or
  • Set the tmp folder somewhere with more space: npm config set tmp /path/to/big/drive/tmp or
  • Build Node yourself and install it somewhere writable with lots of space.

You need to install git. Or, you may need to add your git information to your npm profile. You can do this from the command line or the website. For more information, see «Managing your profile settings».

Running a Vagrant box on Windows fails due to path length issues

@drmyersii went through what sounds like a lot of painful trial and error to come up with a working solution involving Windows long paths and some custom Vagrant configuration:

In the code above, I am appending \? to the current directory absolute path. This will actually force the Windows API to allow an increase in the MAX_PATH variable (normally capped at 260). Read more about max path. This is happening during the sharedfolder creation which is intentionally handled by VBoxManage and not Vagrant’s «synced_folder» method. The last bit is pretty self-explanatory; we create the new shared folder and then make sure it’s mounted each time the machine is accessed or touched since Vagrant likes to reload its mounts/shared folders on each load.

npm only uses git: and ssh+git: URLs for GitHub repos, breaking proxies

I fixed this issue for several of my colleagues by running the following two commands:

One thing we noticed is that the .gitconfig used is not always the one expected so if you are on a machine that modified the home path to a shared drive, you need to ensure that your .gitconfig is the same on both your shared drive and in c:users[your user]

You are trying to talk SSL to an unencrypted endpoint. More often than not, this is due to a proxy configuration error (see also this helpful, if dated, guide). In this case, you do not want to disable strict-ssl – you may need to set up a CA / CA file for use with your proxy, but it’s much better to take the time to figure that out than disabling SSL protection.

This problem will happen if you’re running Node 0.6. Please upgrade to node 0.8 or above. See this post for details.

You could also try these workarounds: npm config set ca «» or npm config set strict-ssl false

  • upgrade your version of npm npm install npm -g —ca=»»
  • tell your current version of npm to use known registrars npm config set ca=»»

If this does not fix the problem, then you may have an SSL-intercepting proxy. (For example, https://github.com/npm/npm/issues/7439#issuecomment-76024878)

Not found / Server error

  • It’s most likely a temporary npm registry glitch. Check npm server status and try again later.
  • If the error persists, perhaps the published package is corrupt. Contact the package owner and have them publish a new version of the package.
  • Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later.
  • This can be caused by corporate proxies that give HTML responses to package.json requests. Check npm’s proxy configuration.
  • Check that it’s not a problem with a package you’re trying to install (e.g. invalid package.json ).

Many ENOENT / ENOTEMPTY errors in output

npm is written to use resources efficiently on install, and part of this is that it tries to do as many things concurrently as is practical. Sometimes this results in race conditions and other synchronization issues. As of npm 2.0.0, a very large number of these issues were addressed. If you see ENOENT lstat , ENOENT chmod , ENOTEMPTY unlink , or something similar in your log output, try updating npm to the latest version. If the problem persists, look at npm/npm#6043 and see if somebody has already discussed your issue.

cb() never called! when using shrinkwrapped dependencies

Take a look at issue #5920. We’re working on fixing this one, but it’s a fairly subtle race condition and it’s taking us a little time. You might try moving your npm-shrinkwrap.json file out of the way until we have this fixed. This has been fixed in versions of npm newer than npm@2.1.5 , so update to npm@latest .

npm login errors

Sometimes npm login fails for no obvious reason. The first thing to do is to log in at https://www.npmjs.com/login and check that your e-mail address on npmjs.com matches the email address you are giving to npm login .

If that’s not the problem, or if you are seeing the message «may not mix password_sha and pbkdf2» , then

  1. Log in at https://npmjs.com/
  2. Change password at https://npmjs.com/password – you can even «change» it to the same password
  3. Clear login-related fields from

/.npmrc – e.g., by running sed -ie ‘/registry.npmjs.org/d’

and it generally seems to work.

npm hangs on Windows at addRemoteTarball

Check if you have two temp directories set in your .npmrc :

Look for lines defining the tmp config variable. If you find more than one, remove all but one of them.

See https://github.com/npm/npm/issues/7590 for more about this unusual problem.

npm not running the latest version on a Windows machine

Источник

Распространённые ошибки при использовании npm, которых лучше не совершать

Npm — это крупнейший менеджер пакетов. Его сравнительно просто и понятно использовать в практике веб-разработки. Но когда речь заходит о применении собственных конфигураций или об использовании продвинутых возможностей npm, многое может пойти не так.

В этом материале я расскажу о семи распространённых ошибках, которые веб-разработчики допускают при работе с npm. В частности, речь пойдёт об управлении зависимостями, о публикации пакетов и ещё о некоторых важных вещах.

1. Ручное добавление зависимостей в файл package.json

Не стоит самостоятельно редактировать файл package.json , так как это может нарушить синхронизацию между этим файлом и package-lock.json .

Вместо этого можно прибегнуть к командам, выполняемым в командной строке, вроде npm i —save и npm i —save-dev , что позволит автоматически обновлять и package.json , и package-lock.json . При таком подходе система ещё и уведомит разработчика о том, что в версиях зависимостей, упомянутых в этих двух файлах, имеются расхождения.

Правда, надо отметить, что использование подобных команд не всегда гарантирует беспроблемное обновление зависимостей.

Например, если выполнить команду вида npm i —save package@

1.0.0 , можно ожидать, что в package.json будет отражена версия пакета, соответствующая той, что указана в команде после @ . Но в подобной команде можно использовать не спецификатор версии

, а спецификатор версии ^ , что позволит расширить возможности по автоматическому обновлению пакета.

Рекомендуется тщательно проверять package.json после обновления зависимостей.

2. Ограничение зависимостей типа peerDependencies конкретной версией патча

Обычно зависимости типа peerDependencies используются для того чтобы обеспечить правильную работу плагинов с хост-пакетами. Если ограничить подобные зависимости конкретными версиями патчей — результат может оказаться не очень хорошим.

Рассмотрим простой пример для того чтобы разобраться с фундаментальной причиной этой проблемы.

В соответствии с вышеприведённым кодом, модуль tea-latte нуждается в конкретной версии (1.x) пакета tea .

Но в проекте могут быть другие пакеты или модули, которые зависят от самой свежей версии пакета tea . В результате ограничение версии пакета tea может привести к непредсказуемому поведению приложения.

Обратите внимание на то, что npm версий 1, 2 и 7 автоматически установит зависимости peerDependencies , если явной зависимости от них нет, выше в дереве зависимостей. А npm версий 3, 4, 5 и 6 выдаст предупреждение.

3. Публикация нескольких модулей в виде единственного пакета

Независимый компонент и схема его зависимостей

Идёт ли речь об UI-библиотеке, о наборе полезных инструментов, или о любой другой группе модулей, публикация нескольких таких сущностей в виде единого пакета — это, практически всегда, неудачная идея.

Нет причин, по которым разработчикам стоит принуждать потребителей их кода привязывать свои проекты к целому набору модулей и компонентов, в ситуациях, когда потребителям все эти модули или компоненты не нужны. У потребителей должна быть возможность выбора конкретного модуля и его версии, он не должен сталкиваться с бессмысленными обновлениями пакетов, происходящими из-за того, что ему не нужно.

Вы, вероятнее всего, согласитесь с вышесказанным, но вас может напугать мысль о необходимости управления монорепозиторием для поддержки всех этих пакетов. На это я могу сказать, что бояться тут нечего.

JavaScript-экосистема уже далеко ушла от тех времён, когда шёл спор между приверженцами монорепозиториев и полирепозиториев.

Теперь мы можем пользоваться возможностями публикации независимых компонентов из простых проектов, наподобие тех, что созданы с использованием Create React App, с возможностью контроля версий, с автоматическим созданием package.json , документации и многого другого. В частности, такие возможности даёт платформа Bit.

4. Случайная публикация секретных данных

Если вы случайно опубликовали модуль, содержащий секретные данные, то первым делом нужно отменить его публикацию.

Но это не решает проблему утечки данных, так как после того, как модуль опубликован, он копируется на все зеркала репозитория пакетов. И если отменить его публикацию — это не позволит исправить ситуацию.

Использование белых списков — это удобный способ, используемый для контроля того, что публикуется в репозиториях пакетов, и для предотвращения публикации секретных данных.

Для применения белых списков публикуемых материалов достаточно добавить в package.json свойство с именем files . В нём можно указать список файлов или папок, которые подлежат публикации.

Рекомендую использовать белые списки для управления тем, что попадает в пакеты, которые планируется публиковать.

5. Использование обычного токена аутентификации

Если вы используете в CI/CD-цепочке приватные модули, вам понадобится воспользоваться токеном аутентификации. Но инструменты npm, работающие в командной строке, при создании подобных токенов не позволяют управлять правами на чтение и на запись.

Токен создаётся вручную, с использованием общедоступного API репозитория, что позволяет избежать уязвимостей систем безопасности, вызванных токенами.

Нижеприведённая команда позволяет создать токен с ограничением доступа только чтением данных:

На сайте npm можно просматривать, добавлять и удалять подобные токены.

Команда для доступа к операциям с токенами

6. Бессмысленное обновление пакетов

Использование самых свежих версий пакетов — это хорошо. Но не стоит обновлять пакеты только из-за того, что выходят их новые версии. Разберёмся с причинами этой рекомендации:

  • В самой свежей версии пакета могут быть ошибки.
  • Обновление пакетов без тщательного изучения изменений может привести к неожиданным эффектам в приложении.
  • Новые возможности могут оказаться ненужными в конкретном проекте.
  • Установка самой свежей версии некоего пакета может привести к проблемам в работе других пакетов, которые от него зависят.

В результате перед обновлением пакетов надо оценить изменения, внесённые в их новые версии, надо подумать о возможных проблемах с совместимостью, а уже после этого, если решено, что это нужно, выполнять обновление.

7. Удаление файла package-lock.json

Веб-разработчики часто удаляют файл package-lock.json для того чтобы решить проблемы, возникающие при работе с npm.

Но так лучше не делать, так как этот файл хранит сведения о точной версии каждого установленного пакета. Если, например, выполнить команду npm update , сведения об обновлённых зависимостях будут отражены в файле package-lock.json .

В результате, вместо того, чтобы, в попытке решения некоей проблемы, удалять файл package-lock.json , можно попробовать следующее:

  • Разрешить конфликты package.json .
  • Изъять package-lock.json из главной ветки репозитория.
  • Снова выполнить команду npm install .

Итоги

Npm — это важнейшая часть любого проекта, основанного на JavaScript, этот менеджер пакетов помогает разработчикам эффективно управлять зависимостями своих проектов.

Но работа с npm сопряжена с множеством ошибок, некоторые из которых могут привести к серьёзным проблемам. Хочется надеяться, что то, о чём мы говорили в этом материале, поможет вам совершать меньше ошибок при работе с npm.

Сталкивались ли вы когда-нибудь с проблемами, вызванными ошибками, допущенными при работе с npm?

Источник

Common errors

Errors

Сломанная установка npm

Если ваш npm сломан:

  • На Mac или Linux переустановите npm .
  • Windows: если вы используете Windows и у вас не работает установка, проще всего переустановить узел из официального установщика (см. Это примечание об установке последней стабильной версии ).

Random errors

  • npm cache clean and trying again.» onmousemove=»i18n(this)»>Некоторые странные проблемы можно решить, просто запустив npm cache clean и повторив попытку.
  • npm install , use the -verbose option to see more details.» onmousemove=»i18n(this)»>Если у вас возникли проблемы с npm install , используйте параметр -verbose , чтобы увидеть более подробную информацию.

Не найдена совместимая версия

Permissions errors

См. Обсуждения в разделах « Загрузка и установка Node.js и npm » и « Устранение ошибок разрешений EACCES при глобальной установке пакетов », чтобы узнать, как избежать и устранить ошибки разрешений.

Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ on Windows 7″ onmousemove=»i18n(this)»> Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ в Windows 7

Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ on Windows 7 is a consequence of joyent/node#8141, and is an issue with the Node installer for Windows. The workaround is to ensure that C:Users AppDataRoamingnpm exists and is writable with your normal user account.» onmousemove=»i18n(this)»>Ошибка Error: ENOENT, stat ‘C:Users AppDataRoamingnpm’ в Windows 7 является следствием joyent / node # 8141 и является проблемой установщика Node для Windows. Обходной путь — убедиться, что C:Users AppDataRoamingnpm существует и доступен для записи с вашей обычной учетной записью.

No space

Вы пытаетесь установить диск,на котором либо нет места,либо нет разрешения на запись.

  • Освободите место на диске или
  • npm config set tmp /path/to/big/drive/tmp or» onmousemove=»i18n(this)»>Установите папку tmp где-нибудь с большим пространством: npm config set tmp /path/to/big/drive/tmp или
  • Соберите Node самостоятельно и установите его где-нибудь,где есть место для записи с большим количеством места.

No git

Вам необходимо установить git . Или вам может потребоваться добавить информацию о git в свой профиль npm. Вы можете сделать это из командной строки или на веб-сайте. Для получения дополнительной информации см. « Управление настройками вашего профиля ».

Запуск блока Vagrant на Windows не удается из-за проблем с длиной пути

@drmyersii прошел через много мучительных проб и ошибок, чтобы предложить рабочее решение, включающее длинные пути Windows и некоторую настраиваемую конфигурацию Vagrant:

\? to the current directory absolute path. This will actually force the Windows API to allow an increase in the MAX_PATH variable (normally capped at 260). Read more about max path. This is happening during the sharedfolder creation which is intentionally handled by VBoxManage and not Vagrant’s «synced_folder» method. The last bit is pretty self-explanatory; we create the new shared folder and then make sure it’s mounted each time the machine is accessed or touched since Vagrant likes to reload its mounts/shared folders on each load.» onmousemove=»i18n(this)»>В приведенном выше коде я добавляю \? К абсолютному пути текущего каталога. Это фактически заставит Windows API разрешить увеличение переменной MAX_PATH (обычно не более 260). Подробнее о максимальном пути . Это происходит во время создания общей папки, которая намеренно обрабатывается VBoxManage, а не методом Vagrant «synced_folder». Последний пункт довольно понятен; мы создаем новую общую папку, а затем убеждаемся, что она монтируется каждый раз, когда к машине обращаются или касаются, поскольку Vagrant любит перезагружать свои монтированные / общие папки при каждой загрузке.

git: and ssh+git: URLs for GitHub repos, breaking proxies» onmousemove=»i18n(this)»>npm использует только git: и ssh+git: URL-адреса для репозиториев GitHub, нарушая прокси

@LaurentGoderre исправил это с помощью некоторых уловок Git :

Я исправил эту проблему для нескольких своих коллег,запустив следующие две команды:

.gitconfig used is not always the one expected so if you are on a machine that modified the home path to a shared drive, you need to ensure that your .gitconfig is the same on both your shared drive and in c:users[your user] » onmousemove=»i18n(this)»>Одна вещь, которую мы заметили, заключается в том, что используемый .gitconfig не всегда является ожидаемым, поэтому, если вы находитесь на машине, которая изменила домашний путь к общему диску, вам необходимо убедиться, что ваш .gitconfig одинаков как на вашем общем диске, так и на в c:users[your user]

SSL Error

strict-ssl – you may need to set up a CA / CA file for use with your proxy, but it’s much better to take the time to figure that out than disabling SSL protection.» onmousemove=»i18n(this)»>Вы пытаетесь подключить SSL к незашифрованной конечной точке. Чаще всего это связано с ошибкой конфигурации прокси (см. также это полезное, хотя и устаревшее, руководство ). В этом случае вам не нужно отключать strict-ssl — вам может понадобиться настроить файл CA/CA для использования с вашим прокси, но гораздо лучше потратить время на то, чтобы разобраться в этом, чем отключать защиту SSL.

Эта проблема может возникнуть, если вы используете Node 0.6. Пожалуйста, обновите до версии 0.8 или выше. Подробности смотрите в этом посте .

npm config set ca «» or npm config set strict-ssl false ‘ onmousemove=»i18n(this)»>Вы также можете попробовать следующие обходные пути: npm config set ca «» или npm config set strict-ssl false

  • npm install npm -g —ca=»» ‘ onmousemove=»i18n(this)»>обновите свою версию npm npm install npm -g —ca=»»
  • npm config set ca=»» ‘ onmousemove=»i18n(this)»>указать вашей текущей версии npm использовать известных регистраторов npm config set ca=»»

Если это не решит проблему, возможно, у вас прокси для перехвата SSL. (Например, https://github.com/npm/npm/issues/7439#issuecomment-76024878 )

SSL-intercepting proxy

Не найдено/Ошибка сервера

  • Скорее всего, это временный сбой реестра npm. Проверьте статус сервера npm и повторите попытку позже.
  • Если ошибка сохраняется,возможно,опубликованный пакет поврежден.Свяжитесь с владельцем пакета и попросите его опубликовать новую версию пакета.

Invalid JSON

  • npm cache clean and/or try again later.» onmousemove=»i18n(this)»>Возможный временный сбой реестра npm или поврежденный кеш локального сервера. Запустите npm cache clean и / или повторите попытку позже.
  • package.json requests. Check npm’s proxy configuration.» onmousemove=»i18n(this)»>Это может быть вызвано корпоративными прокси, которые дают HTML-ответы на запросы package.json . Проверьте конфигурацию прокси-сервера npm .
  • package.json ).» onmousemove=»i18n(this)»>Убедитесь, что это не проблема с пакетом, который вы пытаетесь установить (например, недопустимый package.json ).

ENOENT / ENOTEMPTY errors in output» onmousemove=»i18n(this)»>Многие ошибки ENOENT / ENOTEMPTY в выводе

ENOENT lstat , ENOENT chmod , ENOTEMPTY unlink , or something similar in your log output, try updating npm to the latest version. If the problem persists, look at npm/npm#6043 and see if somebody has already discussed your issue.’ onmousemove=»i18n(this)»>npm написан для эффективного использования ресурсов при установке, и отчасти это связано с тем, что он пытается делать столько вещей одновременно, сколько это возможно. Иногда это приводит к состояниям гонки и другим проблемам синхронизации. Начиная с npm 2.0.0, было решено очень большое количество этих проблем. Если в выводе журнала вы видите ENOENT lstat , ENOENT chmod , ENOTEMPTY unlink или что-то подобное, попробуйте обновить npm до последней версии. Если проблема не исчезнет, ​​посмотрите npm / npm # 6043 и посмотрите, обсуждал ли кто-нибудь вашу проблему.

cb() never called! when using shrinkwrapped dependencies» onmousemove=»i18n(this)»> cb() never called! при использовании термоусадочных зависимостей

We’re working on fixing this one, but it’s a fairly subtle race condition and it’s taking us a little time. You might try moving your npm-shrinkwrap.json file out of the way until we have this fixed. This has been fixed in versions of npm newer than npm@2.1.5 , so update to npm@latest .» onmousemove=»i18n(this)»>Взгляните на выпуск # 5920 . Мы работаем над исправлением этого, но это довольно сложное состояние гонки, и это отнимает у нас немного времени. Вы можете попробовать переместить файл npm-shrinkwrap.json в сторону, пока мы не исправим это. Это было исправлено в версиях npm новее, чем npm@2.1.5 , поэтому обновите до npm@latest .

npm login errors» onmousemove=»i18n(this)»> npm login ошибки входа в npm

npm login fails for no obvious reason. The first thing to do is to log in at https://www.npmjs.com/login and check that your e-mail address on npmjs.com matches the email address you are giving to npm login .’ onmousemove=»i18n(this)»>Иногда npm login завершается неудачно без очевидной причины. Первое, что нужно сделать, это войти в систему на https://www.npmjs.com/login и убедиться, что ваш адрес электронной почты на npmjs.com совпадает с адресом электронной почты, который вы указываете для npm login в npm .

«may not mix password_sha and pbkdf2″ , then» onmousemove=»i18n(this)»>Если проблема не в этом или вы видите сообщение «may not mix password_sha and pbkdf2» , то

  1. Авторизуйтесь на https://npmjs.com/
  2. Смените пароль на https://npmjs.com/password — вы даже можете «сменить» его на тот же пароль

/.npmrc – e.g., by running sed -ie ‘/registry.npmjs.org/d’

/.npmrc » onmousemove=»i18n(this)»>Очистите поля, связанные с входом в систему, из

/.npmrc , например, запустив sed -ie ‘/registry.npmjs.org/d’

и в целом,похоже,это работает.

npm hangs on Windows at addRemoteTarball » onmousemove=»i18n(this)»> npm зависает в Windows на addRemoteTarball

.npmrc :» onmousemove=»i18n(this)»>Проверьте, установлены ли в вашем .npmrc два временных каталога :

tmp config variable. If you find more than one, remove all but one of them.» onmousemove=»i18n(this)»>Найдите строки, определяющие переменную конфигурации tmp . Если вы найдете более одного, удалите все, кроме одного.

Источник

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка прерывание напряжения бортовой сети на эбу
  • Ошибка при вводе данных на госуслугах