之前引用也没有这个问题,一引用ajax就有异常
来源:7-9 Vue项目首页 - 使用 axios 发送 ajax 请求
qq_蓝骏毅_04076633
2020-11-11
ERROR Failed to compile with 1 errors 17:07:24
This dependency was not found:
- axios in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selecto
r.js?type=script&index=0!./src/page/home/Home.vue
To install it, you can run: npm install --save axios
终止批处理操作吗(Y/N)? y
C:\Users\pc\Desktop\travel>npm install webpack-dev-server --save-dev
npm ERR! code ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! errno ERR_TLS_CERT_ALTNAME_INVALID
npm ERR! request to https://registry.cnpmjs.org/webpack-dev-server failed, reaso
n: Hostname/IP does not match certificate’s altnames: Host: registry.cnpmjs.org.
is not in the cert’s altnames: DNS:r.cnpmjs.org
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\node_cache_logs\2020-11-11T09_12_31_446Z-d
ebug.log
C:\Users\pc\Desktop\travel>cnpm install webpack-dev-server --save-dev
| [0/1] Installing util-deprecate@~1.0.1platform unsupported webpack-dev-server@
2.11.5 › chokidar@2.1.8 › fsevents@^1.2.7 Package require os(darwin) not compati
ble with your platform(win32)
\ [0/1] Installing isobject@3.0.1[fsevents@1.2.7] optional install error: Pack
age require os(darwin) not compatible with your platform(win32)
\ [0/1] Installing which-module@^1.0.0[npminstall:get] retry GET https://registr
y.npm.taobao.org/object-inspect/download/object-inspect-1.8.0.tgz?cache=0&sync_t
imestamp=1592545077797&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject
-inspect%2Fdownload%2Fobject-inspect-1.8.0.tgz after 100ms, retry left 4, error:
Error: connect ETIMEDOUT 112.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
errno: ‘ETIMEDOUT’,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘112.92.120.242’,
port: 443,
name: ‘RequestError’,
data: undefined,
path: ‘/object-inspect/-/object-inspect-1.8.0.tgz’,
status: -1,
headers: {},
res: [Object]
}, status: -1, headers: {},
stack: Error: connect ETIMEDOUT 112.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
| [0/1] Installing which-module@^1.0.0[npminstall:get] retry GET https://registr
y.npm.taobao.org/string.prototype.trimend/download/string.prototype.trimend-1.0.
2.tgz?cache=0&sync_timestamp=1603219994262&other_urls=https%3A%2F%2Fregistry.npm
.taobao.org%2Fstring.prototype.trimend%2Fdownload%2Fstring.prototype.trimend-1.0
.2.tgz after 100ms, retry left 4, error: Error: connect ETIMEDOUT 112.92.120.242
:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
errno: ‘ETIMEDOUT’,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘112.92.120.242’,
port: 443,
name: ‘RequestError’,
data: undefined,
path: ‘/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz’,
status: -1,
headers: {},
res: [Object]
}, status: -1, headers: {},
stack: Error: connect ETIMEDOUT 112.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
[npminstall:get] retry GET https://registry.npm.taobao.org/string.prototype.trim
start/download/string.prototype.trimstart-1.0.2.tgz?cache=0&sync_timestamp=16032
19994180&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring.prototype.tri
mstart%2Fdownload%2Fstring.prototype.trimstart-1.0.2.tgz after 100ms, retry left
4, error: Error: connect ETIMEDOUT 112.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
errno: ‘ETIMEDOUT’,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘112.92.120.242’,
port: 443,
name: ‘RequestError’,
data: undefined,
path: ‘/string.prototype.trimstart/-/string.prototype.trimstart-1.0.2.tgz’,
status: -1,
headers: {},
res: [Object]
}, status: -1, headers: {},
stack: Error: connect ETIMEDOUT 112.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
[npminstall:get] retry GET https://registry.npm.taobao.org/object.assign/downloa
d/object.assign-4.1.2.tgz?cache=0&sync_timestamp=1604115194383&other_urls=https%
3A%2F%2Fregistry.npm.taobao.org%2Fobject.assign%2Fdownload%2Fobject.assign-4.1.2
.tgz after 100ms, retry left 4, error: Error: connect ETIMEDOUT 112.92.120.242:4
43
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
errno: ‘ETIMEDOUT’,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘112.92.120.242’,
port: 443,
name: ‘RequestError’,
data: undefined,
path: ‘/object.assign/-/object.assign-4.1.2.tgz’,
status: -1,
headers: {},
res: [Object]
}, status: -1, headers: {},
stack: Error: connect ETIMEDOUT 112.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
[npminstall:get] retry GET https://registry.npm.taobao.org/es-to-primitive/downl
oad/es-to-primitive-1.2.1.tgz after 100ms, retry left 4, error: Error: connect E
TIMEDOUT 112.92.120.238:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
errno: ‘ETIMEDOUT’,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘112.92.120.238’,
port: 443,
name: ‘RequestError’,
data: undefined,
path: ‘/es-to-primitive/-/es-to-primitive-1.2.1.tgz’,
status: -1,
headers: {},
res: [Object]
}, status: -1, headers: {},
stack: Error: connect ETIMEDOUT 112.92.120.238:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
| [0/1] Installing strip-ansi@^4.0.0[npminstall:get] retry GET https://registry.
npm.taobao.org/base64-js/download/base64-js-1.5.0.tgz?cache=0&sync_timestamp=160
5062443822&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbase64-js%2Fdownlo
ad%2Fbase64-js-1.5.0.tgz after 100ms, retry left 4, error: Error: connect ETIMED
OUT 112.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
errno: ‘ETIMEDOUT’,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘112.92.120.242’,
port: 443,
name: ‘RequestError’,
data: undefined,
path: ‘/base64-js/-/base64-js-1.5.0.tgz’,
status: -1,
headers: {},
res: [Object]
}, status: -1, headers: {},
stack: Error: connect ETIMEDOUT 112.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
/ [0/1] Installing strip-eof@^1.0.0platform unsupported webpack-dev-server@2.11.
5 › webpack@3.12.0 › watchpack@1.7.5 › chokidar@3.4.3 › fsevents@~2.1.2 Package
require os(darwin) not compatible with your platform(win32)
| [0/1] Installing wordwrap@0.0.2[fsevents@~2.1.2] optional install error: Packa
ge require os(darwin) not compatible with your platform(win32)
- [0/1] Installing type@^2.0.0[npminstall:get] retry GET https://registry.npm.ta
obao.org/base64-js/download/base64-js-1.5.0.tgz?cache=0&sync_timestamp=160506244
3822&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbase64-js%2Fdownload%2Fb
ase64-js-1.5.0.tgz after 200ms, retry left 3, error: Error: connect ETIMEDOUT 11
2.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
errno: ‘ETIMEDOUT’,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘112.92.120.242’,
port: 443,
name: ‘RequestError’,
data: undefined,
path: ‘/base64-js/-/base64-js-1.5.0.tgz’,
status: -1,
headers: {},
res: [Object]
}, status: -1, headers: {},
stack: Error: connect ETIMEDOUT 112.92.120.242:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
√ Installed 1 packages
√ Linked 422 latest versions
[1/1] scripts.postinstall webpack-dev-server@2.11.5 › webpack@3.12.0 › uglifyjs-
webpack-plugin@^0.4.6 run “node lib/post_install.js”, root: “C:\Users\pc\Desk
top\travel\node_modules\_uglifyjs-webpack-plugin@0.4.6@uglifyjs-webpack-plugi
n”
[1/1] scripts.postinstall webpack-dev-server@2.11.5 › webpack@3.12.0 › uglifyjs-
webpack-plugin@^0.4.6 finished in 60s
√ Run 1 scripts
deprecate webpack-dev-server@2.11.5 › chokidar@^2.1.2 Chokidar 2 will break on n
ode v14+. Upgrade to chokidar 3 with 15x less dependencies.
deprecate webpack-dev-server@2.11.5 › chokidar@2.1.8 › fsevents@^1.2.7 fsevents
1 will break on node v14+ and could be using insecure binaries. Upgrade to fseve
nts 2.
Recently updated (since 2020-11-04): 5 packages (detail see file C:\Users\pc\Des
ktop\travel\node_modules.recently_updates.txt)
Today:
→ webpack-dev-server@2.11.5 › internal-ip@1.2.0 › meow@3.7.0 › normalize-pa
ckage-data@2.5.0 › resolve@^1.10.0(1.19.0) (07:44:03)
→ webpack-dev-server@2.11.5 › webpack@3.12.0 › node-libs-browser@2.2.1 › bu
ffer@4.9.2 › base64-js@^1.0.2(1.5.0) (10:39:27)
√ All packages installed (485 packages installed from npm registry, used 9m(net
work 8m), speed 7.14kB/s, json 423(887.19kB), tarball 2.51MB)
C:\Users\pc\Desktop\travel>npm run dev
travel@1.0.0 dev C:\Users\pc\Desktop\travel
webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
internal/modules/cjs/loader.js:324
throw err;
^
Error: Cannot find module ‘C:\Users\pc\Desktop\travel\node_modules_http-proxy@1
.18.1@http-proxy\node_modules\follow-redirects\index.js’. Please verify that the
package.json has a valid “main” entry
[90m at tryPackage (internal/modules/cjs/loader.js:316:19)[39m
[90m at Function.Module._findPath (internal/modules/cjs/loader.js:705:18)[3
9m
[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:969
:27)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:864:27)[39m
[90m at Module.require (internal/modules/cjs/loader.js:1044:19)[39m
[90m at require (internal/modules/cjs/helpers.js:77:18)[39m
at Object. (C:\Users\pc\Desktop\travel\node_modules\[4m_http-pro
xy@1.18.1@http-proxy[24m\lib\http-proxy\passes\web-incoming.js:5:23)
[90m at Module._compile (internal/modules/cjs/loader.js:1158:30)[39m
[90m at Object.Module._extensions…js (internal/modules/cjs/loader.js:1178:1
0)[39m
[90m at Module.load (internal/modules/cjs/loader.js:1002:32)[39m {
code: [32m’MODULE_NOT_FOUND’[39m,
path: [32m’C:\Users\pc\Desktop\travel\node_modules\_http-proxy@1.18.1@h
ttp-proxy\node_modules\follow-redirects\package.json’[39m,
requestPath: [32m’follow-redirects’[39m
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! travel@1.0.0 dev: webpack-dev-server --inline --progress --config buil d/webpack.dev.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the travel@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\node_cache_logs\2020-11-11T09_31_47_382Z-d
ebug.log
C:\Users\pc\Desktop\travel>cnpm install --save-dev node-sass
× Install fail! Error: EBUSY: resource busy or locked, symlink ‘C:\Users\pc\Des
ktop\travel\node_modules_getpass@0.1.7@getpass’ -> 'C:\Users\pc\Desktop\travel
node_modules_sshpk@1.16.1@sshpk\node_modules\getpass’
Error: EBUSY: resource busy or locked, symlink ‘C:\Users\pc\Desktop\travel\node_
modules_getpass@0.1.7@getpass’ -> 'C:\Users\pc\Desktop\travel\node_modules_ssh
pk@1.16.1@sshpk\node_modules\getpass’
npminstall version: 3.28.0
npminstall args: D:\Program Files\nodejs\node.exe D:\Program Files\nodejs\node_g
lobal\node_modules\cnpm\node_modules\npminstall\bin\install.js --fix-bug-version
s --china --userconfig=C:\Users\pc.cnpmrc --disturl=https://npm.taobao.org/mirr
ors/node --registry=https://r.npm.taobao.org --save-dev node-sass
C:\Users\pc\Desktop\travel>npm run dev
travel@1.0.0 dev C:\Users\pc\Desktop\travel
webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
internal/modules/cjs/loader.js:324
throw err;
^
Error: Cannot find module ‘C:\Users\pc\Desktop\travel\node_modules_http-proxy@1
.18.1@http-proxy\node_modules\follow-redirects\index.js’. Please verify that the
package.json has a valid “main” entry
[90m at tryPackage (internal/modules/cjs/loader.js:316:19)[39m
[90m at Function.Module._findPath (internal/modules/cjs/loader.js:705:18)[3
9m
[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:969
:27)[39m
[90m at Function.Module._load (internal/modules/cjs/loader.js:864:27)[39m
[90m at Module.require (internal/modules/cjs/loader.js:1044:19)[39m
[90m at require (internal/modules/cjs/helpers.js:77:18)[39m
at Object. (C:\Users\pc\Desktop\travel\node_modules\[4m_http-pro
xy@1.18.1@http-proxy[24m\lib\http-proxy\passes\web-incoming.js:5:23)
[90m at Module._compile (internal/modules/cjs/loader.js:1158:30)[39m
[90m at Object.Module._extensions…js (internal/modules/cjs/loader.js:1178:1
0)[39m
[90m at Module.load (internal/modules/cjs/loader.js:1002:32)[39m {
code: [32m’MODULE_NOT_FOUND’[39m,
path: [32m’C:\Users\pc\Desktop\travel\node_modules\_http-proxy@1.18.1@h
ttp-proxy\node_modules\follow-redirects\package.json’[39m,
requestPath: [32m’follow-redirects’[39m
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! travel@1.0.0 dev: webpack-dev-server --inline --progress --config buil d/webpack.dev.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the travel@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\node_cache_logs\2020-11-11T09_39_50_106Z-d
ebug.log
C:\Users\pc\Desktop\travel>
2回答
-
Seagull8796540
2021-01-31
你好, 最好用老师讲课用的axios 这个版本
cnpm install axios@0.17.1 --save
00 -
qq_蓝骏毅_04076633
提问者
2020-11-11
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! travel@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the travel@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! D:\Program Files\nodejs\node_cache\_logs\2020-11-11T10_00_51_688Z-debug.log
012020-11-13
相似问题