방금 npm으로 시작했는데 npm install
명령이 package.json
파일을 자동으로 업데이트해야한다는 것을 이해하는 한 유감 스럽지만 그렇게하지 않았습니다.npm 설치로 package.json을 업데이트하지 않는 이유는 무엇입니까?
$ ls # let's first confirm the folder is empty
$
$ npm init --y
Wrote to /Users/kramer65/Downloads/npmtest/package.json:
{
"name": "npmtest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
난 다음 설치 밑줄 : 보인다
$ npm install underscore
[email protected] /Users/kramer65/Downloads/npmtest
└── [email protected]
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
잘 설치 될 :
내가 OSX에 내가 npmtest라는 새로운 디렉토리에있어 다음과 같은했다
$ ls -l
total 8
drwxr-xr-x 3 kramer65 staff 102 Oct 18 17:47 node_modules
-rw-r--r-- 1 kramer65 staff 221 Oct 18 17:47 package.json
불행히도 npm list
은 package.json
파일에 불만을 표시합니다.
$ npm list
[email protected] /Users/kramer65/Downloads/npmtest
└── [email protected] extraneous
npm ERR! extraneous: [email protected] /Users/kramer65/Downloads/npmtest/node_modules/underscore
내가 확인할 수 있습니다 : 다음 extraneous
플래그 토륨
$ cat package.json
{
"name": "npmtest",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
질문은이다; 파일이 package.json
에 입력되지 않은 이유는 무엇입니까? 자동으로 가야하지 않습니까? 여기서 내가 뭘 잘못하고 있니? 모든 팁을 환영합니다!
'npm install'은'package.json' 파일을 갱신하지 않습니다.'npm install * module name * --save'는'json' 패키지를 갱신합니다. – ZombieChowder
@ ZombieChowder - 아, 고마워. 그것을 받아 들일 수 있도록 대답으로 추가 할 수 있습니까? – kramer65