我正在尝试在未连接到网络的 LAN 上安装 node.js。我已经安装了 node.js 没有任何问题,但似乎 npm 想上网,
http GET https://registry.npmjs.org/moment
所以我无法安装我需要的模块。
这是生成的 npm-debug 文件:
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 'moment',
1 verbose cli '-g' ]
2 info using npm@1.1.69
3 info using node@v0.8.16
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose read json C:\Documents and Settings\User.PALS-DADS\Application Data\npm\package.json
6 verbose read json C:\Documents and Settings\User.PALS-DADS\Application Data\npm\package.json
7 verbose cache add [ 'moment', null ]
8 silly cache add name=undefined spec="moment" args=["moment",null]
9 verbose parsed url { pathname: 'moment', path: 'moment', href: 'moment' }
10 silly lockFile b56def36-moment moment
11 verbose lock moment C:\Documents and Settings\User.PALS-DADS\Application Data\npm-cache\b56def36-moment.lock
12 silly lockFile b56def36-moment moment
13 verbose addNamed [ 'moment', '' ]
14 verbose addNamed [ null, '' ]
15 silly lockFile 42aa250a-moment moment@
16 verbose lock moment@ C:\Documents and Settings\User.PALS-DADS\Application Data\npm-cache\42aa250a-moment.lock
17 silly addNameRange { name: 'moment', range: '', hasData: false }
18 verbose url raw moment
19 verbose url resolving [ 'https://registry.npmjs.org/', './moment' ]
20 verbose url resolved https://registry.npmjs.org/moment
21 info trying registry request attempt 1 at 16:47:42
22 http GET https://registry.npmjs.org/moment
23 info retry will retry, error on last attempt: Error: getaddrinfo ENOENT
24 info trying registry request attempt 2 at 16:47:52
25 http GET https://registry.npmjs.org/moment
26 info retry will retry, error on last attempt: Error: getaddrinfo ENOENT
27 info trying registry request attempt 3 at 16:48:52
28 http GET https://registry.npmjs.org/moment
29 silly lockFile 42aa250a-moment moment@
30 error Error: getaddrinfo ENOENT
30 error at errnoException (dns.js:31:11)
30 error at Object.onanswer [as oncomplete] (dns.js:123:16)
31 error If you need help, you may report this log at:
31 error
31 error or email it to:
31 error
32 error System Windows_NT 5.1.2600
33 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "moment" "-g"
34 error cwd C:\Documents and Settings\User.PALS-DADS\Desktop
35 error node -v v0.8.16
36 error npm -v 1.1.69
37 error syscall getaddrinfo
38 error code ENOTFOUND
39 error errno ENOTFOUND
40 verbose exit [ 1, true ]
如何在不连接网络的情况下安装模块?
谢谢