npm init
2022. 7. 21. 13:46ㆍ웹개발
"scripts": {
// "단축어": "단축어가 할 내용"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
"start-server": "node app.js"
}
package.json(=Configuration file)을 만들기 위한 것
그냥 엔터 치면 디폴트값이 들어감.
딱히 다른건 의미없고 main과 scripts가 중요.
main에 실행하고자 하는 파일 입력, scripts에는 축약어와 그에대한 설명 입력.
처음 생성해두면 후에 npm install 패키지명 쓸 때 마다 패키지가 하나씩 dependancies에 추가된다(동기화).
npm 이후 바로 축약어를 쓸 수 있는 단어들
이외는 npm run 축약어 식으로 써야한다.
>npm start
>npm run start-server
Udemy_Max_Nodejs
728x90
'웹개발' 카테고리의 다른 글
redhat7 MongoDB install with yum error_1 (0) | 2022.08.01 |
---|---|
netstat, ss (0) | 2022.07.29 |
nodemon (0) | 2022.07.21 |
--save vs --save-dev (0) | 2022.07.21 |
mariadb ERROR 1227 (42000) : Access denied (at lease one of) the CREATE USER privilege(s) for this operation (0) | 2022.07.20 |