[npm] package.json

HyunDong Lee·2021년 4월 7일
0

npm

목록 보기
1/1
post-thumbnail

문제

react-native 를 사용해서 프로젝트를 진행하게 되었다. 프로젝트를 진행하기에 앞서 github repository에서 collaborator를 선정해서 팀원들과 함께 진행을 하기로 했는데 내가 앞서 push명령어를 통해서 push를 한 src파일들을 팀원이 git clone 을 사용해서 본인의 local repo에서 작업을 하려고 했다. 문제는 dependency problem인지 나의 개발 환경 문제인지 팀원의 local에서는 작업이 진행이 안되었는데, 이 문제를 해결하기 위해서 gitlab이나 docker를 이용하려고 하던 와중에 문제를 해결했는데 이를 기록하기 위해서 정리했다.

Description

This command installs a package and any packages that it depends on. If the package has a package-lock, or an npm shrinkwrap file, or a yarn lock file, the installation of dependencies will be driven by that, respecting the following order of precedence:

  • yarn.lock
  • package-lock.json
  • npm-shrinkwrap.json

Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program, and perhaps if you also want to be able to easily install it elsewhere after packing it up in a tarball.

npm install
Install the dependencies in the local [node_modules] folder.
By default, npm install will install all modules listed as dependencies in [package.json.]

npm install [folder_name]
Install the package in the directory as a symlink in the current project. Its dependencies will be installed before it's linked. If folder sits inside the root of your porject, its dependencies may be hoisted to the top-level [node_midules] as they would for other types of dependencies.

문제 해결

나는 해당 package-lock.json이 위치한 폴더에서 npm install 명령어를 통해서 dependency를 설치해주면 되는 것이었다.!

0개의 댓글