[nodejs] ERR_PACKAGE_PATH_NOT_EXPORTED
์ํฉ
๋ฆฌ์กํธ๋ฅผ ๋ณต์ตํ๋ ์ค ๊ธฐ์กด์ ๊ณต๋ถํ๋ ํ์ผ์ ์ด์ด๋ณด๋ ค๊ณ ํ๋๋ฐ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค.
$ yarn run start
yarn run v1.22.17
$ react-scripts start
node:internal/modules/cjs/loader:488
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/seob/Desktop/-/node_modules/postcss-safe-parser/node_modules/postcss/package.json
at new NodeError (node:internal/errors:371:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:429:9)
at packageExportsResolve (node:internal/modules/esm/resolve:683:3)
at resolveExports (node:internal/modules/cjs/loader:482:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/seob/Desktop/-/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v18.1.0
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
ํด๊ฒฐ
node ๋ฒ์ ๋ฌธ์ ์์ ํ์ธํ๋ค. ๋ฒ์ ๋ค์ด๊ทธ๋ ์ด๋๋ฅผ ํ๋ฉด ๋๋ค๊ณ ํ๋ค. ํ์ฌ node ๋ฒ์ ์ 18์ด์๋ค.
๋ ธ๋๋ฒ์ ๊ด๋ฆฌ ๋งค๋์ (nvm)์ ๋ค์ด๋ฐ์ผ๋ฉด ํํ์ด์ง์์ ์ง์ ๋ค์ด๋ก๋ ํ ํ์ ์์ด ํฐ๋ฏธ๋๋ก ์กฐ์ ๊ฐ๋ฅํ๋ค.
// nvm ๋ค์ด ๋ฐฉ๋ฒ
curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh> | bash
$
> 0.39.0
// 1. ์๋ ๋ช
๋ น์ด๋ฅผ ์
๋ ฅํ๋ฉด ์ค์น๊ฐ ์ ํ๋์ด์ผ ํ๋ค๋ ๋ฉ์์ง์ด๋ค.
$ nvm use 16
> N/A: version "16 -> N/A" is not yet installed.
You need to run "nvm install 16" to install it before using it.
// 2. 18 ๋ฒ์ -> 16 ๋ฒ์ ๋ค์ด๊ทธ๋ ์ด๋
$ nvm install 16
> Downloading and installing node v16.19.0
Downloading <https://nodejs.org/dist/v16.13.1/node-v16.13.1-darwin-arm64.tar.xz>...
############################################################################################################################### 100.0% ๐ป
Computing checksum with shasum -a 256
Checksums matched!
Now using node v16.19.0 (npm v8.19.3)
Creating default alias: default -> 16 (-> v16.19.0)
// 3. ๋ฒ์ ํ์ธ
$ node-v
> v16.19.0
๊ฒฐ๋ก : [Error Log] ERR_PACKAGE_PATH_NOT_EXPORTED
์๋ฌ ๋ฉ์์ง๋ node๋ฒ์ ์ ๋ฎ์ถฐ์ ์๋ํด๋ด๋ผ
Last updated