2013-10-17 3 views
0

tarfstream을 npm을 사용하여 설치 한 후 일부 명령을 실행했습니다. 출력은 다음과 같습니다.NPM에서 모듈 오류를 찾을 수 없습니다.

사용자 환경은 Node.js 0.10.18 (ia32) 및 npm을 사용하도록 설정되었습니다. 내가 require('tar')을 수행 할 때

C:\Users\abc>npm --version 
1.3.8 

C:\Users\abc>npm list 
C:\Users\abc 
├── [email protected] 
├─┬ [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ └── [email protected] 
├── [email protected] 
├── [email protected] 
├─┬ [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ └─┬ [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ └── [email protected] 
├─┬ [email protected] 
│ ├── [email protected] 
│ └── [email protected] 
└─┬ [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    ├── [email protected] 
    └── [email protected] 


C:\Users\abc>node --version 
v0.10.18 

지금 Node.js를 실행에 내가

> require('fstream') 
Error: Cannot find module 'fstream' 
    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 repl:1:2 
    at REPLServer.self.eval (repl.js:110:21) 
    at Interface.<anonymous> (repl.js:239:12) 
    at Interface.EventEmitter.emit (events.js:95:17) 
    at Interface._onLine (readline.js:202:10) 
    at Interface._line (readline.js:531:8) 
> require('tar') 
Error: Cannot find module 'tar' 
    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 repl:1:2 
    at REPLServer.self.eval (repl.js:110:21) 
    at Interface.<anonymous> (repl.js:239:12) 
    at Interface.EventEmitter.emit (events.js:95:17) 
    at Interface._onLine (readline.js:202:10) 
    at Interface._line (readline.js:531:8) 

내가 무엇을해야합니까

를 얻을?

답변

1

오류는 사용자가 표시 한 모듈로 확인되지 않는 디렉토리에있는 require() 모듈이 C:\Users\abc\node_modules 인 것을 의미합니다.

C:\Users\user2\node_modules 
C:\Users\node_modules 
C:\node_modules 

이 문제를 해결하려면 아이가있는 디렉토리로 이동 : 당신은 C:\Users\user2 같은 디렉토리에 있다면 모듈이 방법으로 검사 할 것이기 때문에

, 모듈은 해결하지 않을 것 node_modules 폴더와 상위 디렉토리를 공유하는 디렉토리를 설치하거나 -g 플래그로 모듈을 전역으로 설치하십시오.

+0

나는 잘 모르겠다. 나는 심지어 -g 플래그로 시도했다. 그러나 아무것도 작동하는 것처럼 보였다. 그럼 내가 다시 시작하고 그것을했습니다. 나는 잘 모르겠다. 나는 잠이 들었을 지 모른다. –

관련 문제