vue添加axios报错

PS C:\CodeSpace2022\Vue\AndyVue\src> npm install
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "_axios@0.26.1@axios": name cannot start with an underscore; name can only contain URL-friendly characters 

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\andyf\AppData\Roaming\npm-cache\_logs\2022-04-03T17_04_02_602Z-debug.log
PS C:\CodeSpace2022\Vue\AndyVue\src> npm run dev
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\CodeSpace2022\Vue\AndyVue\src\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\CodeSpace2022\Vue\AndyVue\src\package.json'
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\andyf\AppData\Roaming\npm-cache\_logs\2022-04-03T17_07_07_748Z-debug.log
PS C:\CodeSpace2022\Vue\AndyVue\src>

0 info it worked if it ends with ok

1 verbose cli [

1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',

1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',

1 verbose cli   'install'

1 verbose cli ]

2 info using npm@6.14.8

3 info using node@v12.19.0

4 verbose npm-session c428aef702fa3843

5 silly install runPreinstallTopLevelLifecycles

6 silly install loadCurrentTree

7 silly install readLocalPackageData

8 timing stage:loadCurrentTree Completed in 28ms

9 silly install loadIdealTree

10 silly install cloneCurrentTreeToIdealTree

11 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms

12 silly install loadShrinkwrap

13 timing stage:loadIdealTree:loadShrinkwrap Completed in 1ms

14 silly install loadAllDepsIntoIdealTree

15 timing stage:rollbackFailedOptional Completed in 0ms

16 timing stage:runTopLevelLifecycles Completed in 38ms

17 silly saveTree src

17 silly saveTree +-- axios@0.26.1

17 silly saveTree | `-- follow-redirects@1.14.9

17 silly saveTree `-- follow-redirects@1.14.9

18 verbose stack Error: Invalid package name "_axios@0.26.1@axios": name cannot start with an underscore; name can only contain URL-friendly characters

18 verbose stack     at invalidPackageName (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-package-arg\npa.js:86:15)

18 verbose stack     at Result.setName (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-package-arg\npa.js:121:11)

18 verbose stack     at new Result (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-package-arg\npa.js:111:23)

18 verbose stack     at Function.resolve (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-package-arg\npa.js:58:15)

18 verbose stack     at C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:493:20

18 verbose stack     at Array.map (<anonymous>)

18 verbose stack     at C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:492:47

18 verbose stack     at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)

18 verbose stack     at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:517:31)

18 verbose stack     at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:574:18)

18 verbose stack     at Promise._settlePromiseCtx (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:611:10)

18 verbose stack     at _drainQueueStep (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:142:12)

18 verbose stack     at _drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:131:9)

18 verbose stack     at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:147:5)

18 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)

18 verbose stack     at processImmediate (internal/timers.js:461:21)

19 verbose cwd C:\CodeSpace2022\Vue\AndyVue\src

20 verbose Windows_NT 10.0.19043

21 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"

22 verbose node v12.19.0

23 verbose npm  v6.14.8

24 error code EINVALIDPACKAGENAME

25 error Invalid package name "_axios@0.26.1@axios": name cannot start with an underscore; name can only contain URL-friendly characters

26 verbose exit [ 1, true ]

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Roam-G

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值