๋ฌธ์ ํด๊ฒฐ
์ด ํ์ด์ง์ ๋ด์ฉ
๊ฒฝ๊ณ
์คํ์ ๊ธฐ๋ฅ
์ด๋ ์คํ์ ์ธ ๊ธฐ๋ฅ์ ๋๋ค. MongoDB๋ ์ค๋ํซ์ ์ง์ํ์ง ์์ต๋๋ค. ์ด ๊ธฐ๋ฅ์ ์ฌ์ ํต์ง ์์ด ๋ณ๊ฒฝ๋๊ฑฐ๋ ์ ๊ฑฐ๋ ์ ์์ต๋๋ค.
๋ฒ๊ทธ๋ ์์๋์ง ์์ง๋ง, ๋ฒ๊ทธ๊ฐ ๋ฐ์ํ๋ฉด Github ๋ฆฌํฌ์งํ ๋ฆฌ ์์ ๋ฌธ์ ๋ฅผ ์ ๊ธฐํ์ธ์. ์ด ํ๋ก์ ํธ์ ๊ฒฝ์ฐ.
๋ค์ ์น์ ์์๋ ๋ฌธ์ ํด๊ฒฐ ์ ์ ์ฌํญ์ ์ ๊ณตํฉ๋๋ค.
npm
๋ก๊ทธ ํ์ผ ๋ณด๊ธฐ
๋ฌธ์ ๊ฐ ๋ฐ์ํ ๊ฒฝ์ฐ npm
๋ก๊ทธ ํ์ผ๋ถํฐ ์์ํ๋ ๊ฒ์ด ์ข์ต๋๋ค. ๋ก๊ทธ ํ์ผ ์์น๋ npm
์ค์น์ ๋ฐ๋ผ ๋ฌ๋ผ์ง๋๋ค. ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
/<NPM USER HOME>/.npm/_logs/2021-09-16T22_03_34_534Z-debug.log
๋ก๊ทธ ํ์ผ์ ์ฐพ์ผ๋ฉด ๊ฐ์ฅ ์ต๊ทผ์ ๋ก๊ทธ ํ์ผ์ ํ์ธํฉ๋๋ค.
๋นํน์ ์ค๋ฅ ๋ฉ์์ง
๋ฌธ์ : mongosh
์ด(๊ฐ) shell ์ ์์ํ๋ ค๊ณ ํ ๋ ๋ถํน์ ํ ์ค๋ฅ ๋ฉ์์ง๋ฅผ ๋ฐํํฉ๋๋ค.
์๋ฃจ์
: ์ค๋ํซ์ ๋นํ์ฑํํ๊ณ mongosh
๋ฅผ ๋ค์ ์์ํ์ฌ ๋๋ฒ๊น
์ ๊ณ์ํฉ๋๋ค.
mongosh --nodb --eval 'config.set("snippetIndexSourceURLs", "")'
์ค๋ฅ: Cannot find module
๋ฌธ์ : ์
ธ์ ์์ํ๋ ค๊ณ ํ๋ฉด mongosh
๊ฐ ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ ๋ฉ์์ง๋ฅผ ๋ฐํํฉ๋๋ค.
Error: Cannot find module '/<PATH to USER HOME>/.mongodb/mongosh/snippets/node_modules/@<REGISTRY NAME>/bad-snippet-name'
npm ๋ก๊ทธ ํ์ผ ์๋ ๋ค์๊ณผ ๊ฐ์ ์ค์ด ์์ ์ ์์ต๋๋ค.
36 error code ELSPROBLEMS 37 error missing: @<REGISTRY NAME>/bad-snippet-name@*, required by snippets@
ํด๊ฒฐ์ฑ
: ~/.mongodb/mongosh/snippets/package.json
ํ์ผ์ ํธ์งํ์ฌ bad-snippet-name
๊ฐ ์๋ ์ค์ ์ ๊ฑฐํฉ๋๋ค.
์ด ์์์๋ ์ ์ค์ ํํ ์ผํ๋ ์ญ์ ํ๋ ๊ฒ์ ์์ง ๋ง์ธ์.
{ "dependencies": { "@mongosh/snippet-analyze-schema": "^1.0.5", "@mongosh/snippet-spawn-mongod": "^1.0.1", "npm": "*", "@<REGISTRY NAME>/bad-snippet-name": "^1.0.7" } }
์ค๋ํซ ์ ๊ฑฐ ์คํจ
๋ฌธ์ : ์ ๊ฑฐ๋ ์คํจํ์ง๋ง ์ค๋ฅ ๋ฉ์์ง๋ ๋ค๋ฅธ ์ค๋ํซ์ ์ฐธ์กฐํฉ๋๋ค.
์๋ ์ค๋ฅ ๋ฉ์์ง๋ ๊ฐ๋ ์ฑ์ ์ํด ๋ค์ ํฌ๋งท๋์์ต๋๋ค.
Running uninstall... Uncaught: Error: Command failed: /usr/bin/mongosh /root/.mongodb/mongosh/snippets/node_modules/npm/bin/npm-cli.js --no-package-lock --ignore-scripts --registry=https://registry.npmjs.org uninstall --save @mongosh/snippet-mongocompat with exit code 1: \ npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/@<REGISTRY NAME>%2fbad-snippet-name - Not found npm ERR! 404 npm ERR! 404 '@<REGISTRY NAME>/bad-snippet-namen@*' is not in this registry.
ํด๊ฒฐ์ฑ
: package.json
ํ์ผ์ ํธ์งํ์ฌ ๋๋ฝ๋ ํญ๋ชฉ์ ์ ๊ฑฐํฉ๋๋ค. ์ด ์์์๋ ์์ ์ค์์ ๊ฐ์กฐ ํ์๋ ์ค๊ณผ ํํ ์ผํ๋ฅผ ์ญ์ ํฉ๋๋ค.
{ "dependencies": { "@mongosh/snippet-analyze-schema": "^1.0.5", "@mongosh/snippet-spawn-mongod": "^1.0.1", "npm": "*", "@<REGISTRY NAME>/bad-snippet-name": "^1.0.7" } }