npm 初始化 vscode 终端中的问题
**
代码一:
.PS C:\Users\liuxuan\Desktop\node.day04\10文件> npm i jquery
npm ERR! path C:\Users\liuxuan\Des``ktop\node.day04\09-lyb2.0\http:\registry.npm.taobao.org\jquery\download\jquery-3.2.0.tgz
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall stat
npm ERR! enoent ENOENT: no such file or directory, stat ‘C:\Users\liuxuan\Desktop\node.day04\09-lyb2.0\http:\registry.npm.taobao.org\jquery\download\jquery-3.2.0.tgz’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\liuxuan\AppData\Roaming\npm-cache_logs\2019-06-15T01_45_13_650Z-debug.log
若在vscode中有上述问题,就采用如下步骤解决
PS C:\Users\liuxuan\Desktop\node.day04\10文件> npm init
会出现如下代码:
**’
代码二:
**```
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See npm help json
for definitive documentation on these fields
and exactly what they do.
Use npm install <pkg>
afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (10文件) lala
version: (1.0.0)
description:
entry point: (01.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to C:\Users\liuxuan\Desktop\node.day04\10文件\package.json:
**每一项默认值,按enter即可**
**
## 代码三
**
**Is this OK? (yes) 输入 yes**
***
## **代码四:**
***PS C:\Users\liuxuan\Desktop\node.day04\10文件> npm i jquery
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN lala@1.0.0 No description
npm WARN lala@1.0.0 No repository field.
+ jquery@3.4.1
added 1 package from 1 contributor and audited 1 package in 1.845s
found 0 vulnerabilities
PS C:\Users\liuxuan\Desktop\node.day04\10文件>
**完成**