나는 NodeJS에서 절대적으로 새로운 것이므로 다음과 같은 문제가 있습니다. NodeJ v6.2.0을 사용하고 있습니다.왜 NodeJS "body-parse"모듈을 설치할 수 없습니까? 그것은 npm 레지스트리에 없다고 말합니다
이 한 Statment하여 NodeJS 프로그램을 수행하려고 :
node index
나는 다음과 같은 오류 메시지가 얻을 수 있어요 : 그래서 tryied 한
C:\Users\Andrea\Documents\WS_vari\REST\URIDemo>node index
module.js:442
throw err;
^
Error: Cannot find module 'body-parser'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\Andrea\Documents\WS_vari\REST\URIDemo\index.js:6:18)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
에 의해이 몸 파서 모듈을 설치 할을 :
npm install body-parse
그래서
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'body-parse' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData body-parse
8 silly fetchNamedPackageData body-parse
9 silly mapToRegistry name body-parse
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry data Result {
12 silly mapToRegistry raw: 'body-parse',
12 silly mapToRegistry scope: null,
12 silly mapToRegistry name: 'body-parse',
12 silly mapToRegistry rawSpec: '',
12 silly mapToRegistry spec: 'latest',
12 silly mapToRegistry type: 'tag' }
13 silly mapToRegistry uri https://registry.npmjs.org/body-parse
14 verbose request uri https://registry.npmjs.org/body-parse
15 verbose request no auth needed
16 info attempt registry request try #1 at 18:37:02
17 verbose request id 293a3f738f677ca2
18 http request GET https://registry.npmjs.org/body-parse
19 http 404 https://registry.npmjs.org/body-parse
20 verbose headers { 'content-type': 'application/json',
20 verbose headers 'cache-control': 'max-age=0',
20 verbose headers 'content-length': '2',
20 verbose headers 'accept-ranges': 'bytes',
20 verbose headers date: 'Mon, 26 Dec 2016 17:38:07 GMT',
20 verbose headers via: '1.1 varnish',
20 verbose headers age: '0',
20 verbose headers connection: 'keep-alive',
20 verbose headers 'x-served-by': 'cache-fra1247-FRA',
20 verbose headers 'x-cache': 'MISS',
20 verbose headers 'x-cache-hits': '0',
20 verbose headers 'x-timer': 'S1482773886.298464,VS0,VE707',
20 verbose headers vary: 'Accept-Encoding' }
21 silly get cb [ 404,
21 silly get { 'content-type': 'application/json',
21 silly get 'cache-control': 'max-age=0',
21 silly get 'content-length': '2',
21 silly get 'accept-ranges': 'bytes',
21 silly get date: 'Mon, 26 Dec 2016 17:38:07 GMT',
21 silly get via: '1.1 varnish',
21 silly get age: '0',
21 silly get connection: 'keep-alive',
21 silly get 'x-served-by': 'cache-fra1247-FRA',
21 silly get 'x-cache': 'MISS',
21 silly get 'x-cache-hits': '0',
21 silly get 'x-timer': 'S1482773886.298464,VS0,VE707',
21 silly get vary: 'Accept-Encoding' } ]
22 silly fetchPackageMetaData Error: Registry returned 404 for GET on https://registry.npmjs.org/body-parse
22 silly fetchPackageMetaData at makeError (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:264:12)
22 silly fetchPackageMetaData at CachingRegistryClient.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:242:14)
22 silly fetchPackageMetaData at Request._callback (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:172:14)
22 silly fetchPackageMetaData at Request.self.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:200:22)
22 silly fetchPackageMetaData at emitTwo (events.js:106:13)
22 silly fetchPackageMetaData at Request.emit (events.js:191:7)
22 silly fetchPackageMetaData at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:1067:10)
22 silly fetchPackageMetaData at emitOne (events.js:101:20)
22 silly fetchPackageMetaData at Request.emit (events.js:188:7)
22 silly fetchPackageMetaData at IncomingMessage.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:988:12)
22 silly fetchPackageMetaData error for body-parse { Error: Registry returned 404 for GET on https://registry.npmjs.org/body-parse
22 silly fetchPackageMetaData at makeError (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:264:12)
22 silly fetchPackageMetaData at CachingRegistryClient.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:242:14)
22 silly fetchPackageMetaData at Request._callback (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:172:14)
22 silly fetchPackageMetaData at Request.self.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:200:22)
22 silly fetchPackageMetaData at emitTwo (events.js:106:13)
22 silly fetchPackageMetaData at Request.emit (events.js:191:7)
22 silly fetchPackageMetaData at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:1067:10)
22 silly fetchPackageMetaData at emitOne (events.js:101:20)
22 silly fetchPackageMetaData at Request.emit (events.js:188:7)
22 silly fetchPackageMetaData at IncomingMessage.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:988:12) pkgid: 'body-parse', statusCode: 404, code: 'E404' }
23 silly rollbackFailedOptional Starting
24 silly rollbackFailedOptional Finishing
25 silly runTopLevelLifecycles Starting
26 silly runTopLevelLifecycles Finishing
27 silly install printInstalled
28 verbose stack Error: Registry returned 404 for GET on https://registry.npmjs.org/body-parse
28 verbose stack at makeError (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:264:12)
28 verbose stack at CachingRegistryClient.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:242:14)
28 verbose stack at Request._callback (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\request.js:172:14)
28 verbose stack at Request.self.callback (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:200:22)
28 verbose stack at emitTwo (events.js:106:13)
28 verbose stack at Request.emit (events.js:191:7)
28 verbose stack at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:1067:10)
28 verbose stack at emitOne (events.js:101:20)
28 verbose stack at Request.emit (events.js:188:7)
28 verbose stack at IncomingMessage.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\request.js:988:12)
29 verbose statusCode 404
30 verbose pkgid body-parse
31 verbose cwd C:\Users\Andrea\Documents\WS_vari\REST\URIDemo
32 error Windows_NT 6.3.9600
33 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "body-parse"
34 error node v6.2.0
35 error npm v3.8.9
36 error code E404
37 error 404 Registry returned 404 for GET on https://registry.npmjs.org/body-parse
38 error 404
39 error 404 'body-parse' is not in the npm registry.
40 error 404 You should bug the author to publish it (or use the name yourself!)
41 error 404 Note that you can also install from a
42 error 404 tarball, folder, http url, or git url.
43 verbose exit [ 1, true ]
이를 찾을 수없는 것 같습니다 :
C:\Users\Andrea\Documents\WS_vari\REST\URIDemo>npm install body-parse
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "
body-parse"
npm ERR! node v6.2.0
npm ERR! npm v3.8.9
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/body-parse
npm ERR! 404
npm ERR! 404 'body-parse' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Andrea\Documents\WS_vari\REST\URIDemo\npm-debug.log
C:\Users\Andrea\Documents\WS_vari\REST\URIDemo>
이 지정된 NPM-debug.log를 로그 파일의 내용은 다음과 같습니다의 방법이 오류 메시지를 획득하고 몸체 해석을 npm 레지스트리에 입력하십시오. npm install --save body-parser
을 --save 무엇을 의미? – AndreaNobili
--save는 package.json에 모듈 이름을 저장하는 데 사용됩니다. – Codesingh