NPM이 종속성을 설치하지 않습니까?


8

npm install -d정의 된 package.json파일 이있는 프로젝트 디렉토리에 NPM이 종속성을 설치하는 데 문제가 있습니다.

여기 내 package.json: https://gist.github.com/3068312

그리고 프로젝트 루트의 노드 모듈 폴더 ( rm -rf node_modules)를 닦은 후 프로젝트 루트에서 실행 npm install -d하고 다음과 같이 인사합니다.

(ssh) /vagrant git:master ❯ npm install -d                                                                                                                                                                  
npm info it worked if it ends with ok
npm info using npm@1.1.4
npm info using node@v0.6.12
npm info preinstall redeye@0.0.1
npm http GET https://registry.npmjs.org/sinon
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/mocha
npm http GET https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/sinon
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/mocha
npm http 304 https://registry.npmjs.org/request
npm info into /vagrant underscore@1.3.3
npm info into /vagrant mocha@1.3.0
npm info into /vagrant sinon@1.3.4
npm info into /vagrant request@2.9.203
npm info installOne underscore@1.3.3
npm info installOne mocha@1.3.0
npm info installOne sinon@1.3.4
npm info installOne request@2.9.203
npm info unbuild /vagrant/node_modules/underscore
npm info unbuild /vagrant/node_modules/mocha
npm info unbuild /vagrant/node_modules/sinon
npm info unbuild /vagrant/node_modules/request
npm ERR! error installing underscore@1.3.3
npm info unbuild /vagrant/node_modules/underscore
npm ERR! error rolling back underscore@1.3.3 Error: UNKNOWN, unknown error '/vagrant/node_modules/underscore'

npm ERR! Error: ENOENT, no such file or directory '/vagrant/node_modules/underscore/package.json'
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /vagrant/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "node" "/usr/bin/npm" "install" "-d"
npm ERR! cwd /vagrant
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! path /vagrant/node_modules/underscore/package.json
npm ERR! code ENOENT
npm ERR! message ENOENT, no such file or directory '/vagrant/node_modules/underscore/package.json'
npm ERR! errno {}
npm ERR! error installing request@2.9.203
npm info unbuild /vagrant/node_modules/request
npm ERR! error rolling back request@2.9.203 Error: UNKNOWN, unknown error '/vagrant/node_modules/request'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /vagrant/npm-debug.log
npm not ok

다시 실행 npm install -d하면 오류가 다음 패키지가 무엇이든 변경됩니다 ... 계속해서 계속 실행하면 더 이상 불평하지 않고 출력됩니다.

(ssh) /vagrant git:master ❯ npm install -d                                                                                                                                                               
npm info it worked if it ends with ok
npm info using npm@1.1.4
npm info using node@v0.6.12
npm info preinstall redeye@0.0.1
npm info build /vagrant
npm info linkStuff redeye@0.0.1
npm info install redeye@0.0.1
npm info postinstall redeye@0.0.1
npm info ok

그러나 이러한 패키지에 대한 종속성은 설치되지 않습니다. 예를 들어 cheerio몇 가지 종속성이 있으므로 테스트 스위트를 실행하려고하면 다음과 같이 인사합니다.

(ssh) /vagrant git:master ❯ mocha --compilers coffee:coffee-script --watch spec/*                                                                                                                           


node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module 'cheerio-select'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:354:17)

무엇을 제공합니까? 나는 Ubuntu Precise64에 Vagrant virtual box에 있습니다.

답변:


1

어쩌면 vagrant에 대한 symlink와 관련된 문제 와이 문제 : https://github.com/isaacs/npm/issues/2380

시험

npm install --no-bin-link

또한 여기에 설명 : http://www.conroyp.com/2013/04/13/symlink-shenanigans-nodejs-npm-express-vagrant/


Docker Tutorial prakhar.me/docker-curriculum/#dockerrun 을 시도하는 동안 root @ ip-172-31-22-20 : ~ / docker-curriculum # docker build -t ashishkarpe / foodtrucks-web을 실행하는 동안 동일한 오류가 발생합니다.
Ashish Karpe

0

시도 했습니까 npm cache clean?

며칠 전에 Qunit에 대한 종속성을 설치하려고하는 시간이 지났고 phantonjs가 첫 번째 실행에서 빌드하지 못했기 때문에 npm은 바이너리를 다시 가져 오지 않았고 단지 시도하려고했습니다. 캐시 된 것에서 빌드하십시오. 캐시를 비우고 다시 실행 한 후 다시 가져 npm install와서 성공적으로 빌드되었습니다.

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.