Programing

npm 설치 오류 (오류 : ENOENT, chmod)

crosscheck 2020. 8. 7. 08:00
반응형

npm 설치 오류 (오류 : ENOENT, chmod)


방금 게시 한 npm 모듈을 전역 적으로 설치하려고합니다. npm 또는 폴더에서 설치하려고 할 때마다이 오류가 발생합니다.

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

나는 sudo를 사용하고 있으며 모든 것이 작동 해야하는 패키지의 모든 것을 세 번 확인했습니다. 나는 주위를 둘러 보았고, 해결되지 않은 몇 가지 유사한 사례를 보았습니다. 여기 내가 시도한 것입니다.

  • npm ( sudo npm install -g npm) 업그레이드
  • 전역 npm 캐시 지우기 ( sudo npm cache clear)
  • 사용자 npm 캐시 지우기 ( npm cache clear)

특히 npm이 chmod를 수행하려고 할 때 오류가 경로에 연결하는 파일과 관련이 있음을 알았습니다. 그것은 문제가되지 않을 것이고, 나의 lib/cli.js정상적인 권한을 가지고 있으며, npm은이 설치 동안 수퍼 유저 권한을 가지고 있습니다.

npm 문서를 살펴본 후 npm이 bin 링크 ( --no-bin-links) 를 만들지 못하게하는 옵션을 찾았 습니다. 설치를 시도했을 때 제대로 작동했습니다.

그래서 거래는 무엇입니까? 이것은 몇 가지인가 이상한 프린지 경우 버그 해결책을 아직하지?

편집 : 참고로 여기 에 업로드 한 모듈이 있습니다.


.gitignore, NPM이 .npmignore파일 의 기반으로 사용 하고 있으므로 /lib. .npmignore애플리케이션의 루트에 파일을 추가하면 모든 것이 작동합니다.

[편집]-이 동작에 대한 자세한 정보 : https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package


비슷한 문제가 발생했습니다.

npm cache clean

해결했습니다.


이 문제는 내가 실행하려고 할 때 Mac에서 나에게 어떻게 든 발생했습니다 npm install -g bower. graceful-fs와 같은 것을 찾을 수 없다는 이유로 많은 오류가 발생했습니다. 원래 npm을 어떻게 설치했는지 잘 모르겠지만 homebrew를 사용하는 노드가있는 것 같습니다. 나는 처음 달렸다

brew uninstall node

이것은 모두 제거 node하고 npm내 길에서. 거기에서 방금 다시 설치했습니다.

brew install node

이 완료되면 내가 가지고 nodenpm내 길에 내가 실행 할 수 있었다

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

그러면 정자가 성공적으로 설치되었습니다.

양조 공식을 업데이트하고 설치를 업그레이드하는 것이 저에게 효과가없는 것 같았습니다. 이유를 모르겠습니다. .npm폴더 제거는 다른 사람들에게도 효과가 있었으며 성공하지 못했습니다. 이번에는 혹시라도 했어요. 다음 중 어느 것도 문제를 해결하지 못했지만 다른 사람에게는 해결되지 않았습니다.

npm cache clean
sudo npm cache clean

npm 설치 시이 오류가 발생했으며 .npmignore를 추가해도 해결되지 않았습니다.

오류 : ENOENT, 상태 'C : \ Users \ My-UserName \ AppData \ Roaming \ npm'

언급 된 폴더로 이동하려고했지만 존재하지 않았습니다. Roaming 폴더에 npm 폴더를 만들 때 오류가 수정되었습니다 .

이것은 Windows 8.1에 있습니다.


나는 같은 문제가 있었고 여기에 언급되지 않은 처리를 발견했습니다. 커뮤니티에 기여하고 싶지만 :

npm install -g myappbin디렉토리를 복사하지 않았습니다 . 나는 그것을 files안에 포함하지 않았기 때문에 이것을 발견 했습니다.package.json

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

npm install많은 종속성을 시도 할 때 유사한 오류 메시지가 나타납니다 . 그들 중 일부 /usr/bin/node는 노드 실행 파일이 될 것으로 예상 하기 때문에 Debian / Ubuntu에 설치하지 못하는 것으로 나타났습니다 . 수정하려면해야 할 일

sudo ln -s nodejs /usr/bin/node 

또는 더 나은 방법은

sudo apt-get install nodejs-legacy

자세한 정보 : https://stackoverflow.com/a/21171188/7581


npm install로컬 설치에서 비슷한 오류가 발생했습니다 .

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

오류의 원인은 확실하지 않지만 최근에 몇 개의 새 노드 모듈을 로컬에 설치하고 homebrew로 노드를 업그레이드하고 'npm update -g'를 실행했습니다.

문제를 해결할 수있는 유일한 방법은 로컬 node_modules 디렉토리를 완전히 삭제하고 npm install다시 실행하는 것입니다.

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

게시 된 npm 패키지에서 컴파일 된 커피 스크립트가 누락 된 것 같습니다. 게시 전 명령을 작성해보십시오 .


제 경우에는 (다중 코드 ENOENT errno 34) 문제가 ~/.npm/디렉토리 액세스에있었습니다. 그 안에는 root:root권한 이있는 하위 디렉토리가있어서 일반 사용자로 명령을 실행하는 동안 문제가 발생했습니다 sudo. 그래서 ~/.npm/dir 내의 모든 하위 디렉토리 와 파일의 소유권을 로컬 사용자와 그룹으로 변경했습니다. 그것은 내 Ubuntu에서 트릭을 수행했습니다 (Mac에서도 작동해야 함).

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

사용자 이름을 알아야합니다. 그렇죠? 그렇지 않은 경우 다음 $ whoami같이 실행 하고 그룹 이름도 함께 대체하십시오.

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

편집하다:

테스트 케이스 :

내 로컬 계정 에서 다음과 같이 /home/johnb전 세계적으로 일부 생성기를 설치 yeoman했습니다.

$ sudo npm install -g generator-laravel

문제 성격 :

위의 작업으로 인해 ~/.npm/dir 내부에 일부 종속성이 설치되어 root:root소유권이 sudo ...있습니다. 분명히 npm은 종속성을 가져 와서 로컬 사용자 subdir에 쓸 때 로컬 사용자로 실행되지 않습니다 (또는 나중에 종속성 하위 디렉토리 소유권을 변경) ~/.npm/. npm이 근본적인 유닉스 파일 시스템 보안 문제에 대해 너무 부주의하다면 문제가 다시 발생합니다.

해결책 :

  1. ~/.npm/특히 sodo(root)로 무언가를 설치하거나 업데이트 할 때 로컬 사용자 계정이 아닌 소유권 (및 / 또는 권한)이있는 하위 디렉터리가 포함되어 있는지 지속적으로 확인합니다 . 그렇다면 내부 소유권 ~/.npm/을 재귀 적으로 로컬 사용자로 변경하십시오 .

  2. npm, bower, grunt, ...위에서 설명한대로이 문제를 해결하도록 커뮤니티에 요청 하십시오.


grunt 플러그인을 설치하는 동안이 오류가 발생했습니다. 오래된 버전의 npm이 있고 npm을 최신 버전으로 업데이트 한 후 오류가 사라졌습니다.

npm install -g npm

나는 비슷한 문제가 특별히 있습니다 : ERR! enoent ENOENT : 그런 파일이나 디렉토리가 없습니다. chmod 'node_modules / npm / node_modules / request / node_modules / http-signature / node_modules / sshpk / bin / sshpk-conv 위의 모든 솔루션을 시도했지만 운이 없었습니다. 나는 방랑 함을 사용하고 있었고 프로젝트는 공유 폴더에있었습니다. 프로젝트를 공유되지 않은 다른 폴더 (두 번째 호스트)로 옮길 때 문제는 거기에만있는 것 같습니다. 문제 해결됨. 다른 사람이 방랑자를 사용하는 경우를 대비하여


인터넷 ( npm cache clearrm -rf ~/.npm)에서 찾은 모든 항목을 시도 했지만 아무것도 작동하지 않는 것 같습니다. 문제를 해결 한 것은 노드 (및 npm)를 최신 버전으로 업데이트하는 것이 었습니다. 해봐


Windows에서도 비슷한 오류가 발생했습니다. 붙여 넣기 앱 데이터를 검색하고 문자열을 검색합니다 npm.

나는 문자열 교체 'npm'로 (따옴표 포함)을 'npm.cmd'모두 atlasboard\lib\package-dependency-manager.jsatlasboard\lib\cli\commands.js. 문제가 해결되었습니다.


npm install -g mymodule존재하지 않는 스크립트가있는 패키지의 전역 설치 ( ) 중에 동일한 오류가 발생 합니다.

package.json에서 :

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

그러나 ./bin/module라는 이름으로 존재하지 않았습니다 modulejs.


  1. 최신 버전의 노드 설치
  2. 실행 : npm cache clean
  3. 실행 : npm install cordova -g

node.js가 어떻게 든 손상된 경우이 오류가 발생할 수 있습니다. node.js를 완전히 제거 / 다시 시작 / 설치하여이 오류를 수정했으며이 오류와 발생하는 다른 세 가지 신비한 오류를 수정했습니다.


npm으로 업그레이드 한 후 비슷한 동작이 발생했습니다 6.1.0. 한 번 작동하는 것처럼 보였지만 파일 시스템에 경로로 지정된 패키지를 설치하려고 시도하는 동안이 오류가 발생했습니다.

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

다음 은 문제를 해결하지 못했습니다 .

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

어떻게이 문제를 해결 :

  • rm package-lock.json

package.json의 "디렉터리"및 "파일"키에 대한 잘못된 값에주의하십시오.

새 애플리케이션으로 시작하고 완전히 공백으로 시작하려면 완전한 빈 폴더에서 시작하거나 유효한 package.json 파일이 있어야합니다.

package.json 파일을 먼저 생성하지 않으려면 다음을 입력하십시오. npm i some_package

이름이 "some_package"인 패키지는 새 하위 폴더 "node_modules"에 올바르게 설치되어야합니다.

package.json 파일을 먼저 생성하는 경우 다음을 입력합니다. npm init모든 기본값 유지 (Enter를 클릭하여), 유효한 파일이 생성되어야합니다.

다음과 같아야합니다.

{
  "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".


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.)


I was getting the error "Error: ENOENT, stat 'C:\Users\userName\AppData\Roaming\npm'. But there was no such directory. Created the directory and the npm install started working


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:\Users\THE_USERNAME\AppData\Local\Temp\npm-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:\Users\THE_USERNAME\npm-temp\npm-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


While installing ionic I got below error

115648 error enoent ENOENT: no such file or directory, rename 'C:\Users\UserName\AppData\Roaming\npm\node_modules.staging\ansi-b11f0c4b' -> 'C:\Users\UserName\AppData\Roaming\npm\node_modules\ionic\node_modules\cordova-lib\node_modules\ansi'

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


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


None of the above worked for me. But yarn install worked, then npm i started working. Not sure what yarn fixed, but quick and easy solution!


First do

 npm rm -rdf node_modules

then do

npm install

After that install whatever files you want to add


Creating a new React app in C:\Users\CM\Downloads\react\github-profile.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

npm ERR! path C:\Users\CM\AppData\Roaming\npm-cache_cacache\content- 

v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1fa335b1
0893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93d00f806

npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall lstat
npm ERR! Error: EPERM: operation not permitted, lstat 
'C:\Users\CM\AppData\Roaming\npm-cache_cacache\content- 
v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996
b1fa335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec6
5545008a3cad93d00f806'
npm ERR! { [Error: EPERM: operation not permitted, lstat 
'C:\Users\CM\AppData\Roaming\npm-cache_cacache\content- 
v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1f 
a335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec6554500
8a3cad93d00f806']

npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, lstat 
'C:\Users\CM\AppData\Roaming\npm-cache_cacache\content- 
v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1
fa335b10893d67f7339e4 
af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93d00f806'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'lstat',
npm ERR! path:
npm ERR! 'C:\Users\CM\AppData\Roaming\npm-cache\_cacache\content- 


npm ERR! stack:
npm ERR! 'Error: EPERM: operation not permitted, lstat 
'C:\Users\CM\AppData\Roaming\npm-cache\_cacache\content- 
v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996
b1fa335b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015
eec65545008a3cad93d00f806'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'lstat',
npm ERR! path:
npm ERR! 'C:\Users\CM\AppData\Roaming\npm-cache\_cacache\content- 
v2\sha512\36\c6\c3e97514319bc1c6d40026e58325e782e1016c996b1fa335
b10893d67f7339e4af62bb688c0da2aaca839d4c9d51e2eb015eec65545008a3cad93
d00f806',
npm ERR! parent: 'postcss-image-set-function' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a
text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double- 
check thenpm ERR! permissions of the file and its containing directories, or 
try  running

npm ERR! the command again as root/Administrator (though this is not 
recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\CM\AppData\Roaming\npm-cache_logs\2019-03-22T10_
27_19_722Z-debug.log


Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react- 
scripts   has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting GitHub-profile/ from C:\Users\CM\Downloads\reactDone.``

i was facing similar error but i tried to run create-react-app command many times and finally it was created , this was the problem with my internet connection. check your internet connection


Please try this

SET HTTP_PROXY=<proxy_name>

Then try that command.It will work

참고URL : https://stackoverflow.com/questions/17990647/npm-install-errors-with-error-enoent-chmod

반응형