Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] npm run dev执行失败 #26

Closed
youthbupt opened this issue Oct 18, 2023 · 3 comments
Closed

[bug] npm run dev执行失败 #26

youthbupt opened this issue Oct 18, 2023 · 3 comments

Comments

@youthbupt
Copy link

xagent@0.0.0 dev
vite --host

file:///XAgent/XAgentWeb/node_modules/vite/bin/vite.js:7
await import('source-map-support').then((r) => r.default.install())
^^^^^

SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
at async link (internal/modules/esm/module_job.js:42:21)
npm ERR! code 1
npm ERR! path /home/ys/XAgent/XAgentWeb
npm ERR! command failed
npm ERR! command sh -c vite --host

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-10-18T12_14_44_491Z-debug.log

执行失败log ( /root/.npm/_logs/2023-10-18T12_14_44_491Z-debug.log )

0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'dev' ]
1 info using npm@7.5.2
2 info using node@v12.22.12
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/share/nodejs/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/home/ys/XAgent/XAgentWeb/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/root/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 5ms
19 verbose npm-session 8f61d137f4f07a4c
20 timing npm:load Completed in 11ms
21 timing command:run-script Completed in 82ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess. (/usr/share/nodejs/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack at ChildProcess.emit (events.js:314:20)
22 verbose stack at maybeClose (internal/child_process.js:1022:16)
22 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
23 verbose pkgid xagent@0.0.0
24 verbose cwd /XAgent/XAgentWeb
25 verbose Linux 5.10.0-23-amd64
26 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
27 verbose node v12.22.12
28 verbose npm v7.5.2
29 error code 1
30 error path /home/ys/XAgent/XAgentWeb
31 error command failed
32 error command sh -c vite --host
33 verbose exit 1

@youthbupt
Copy link
Author

在XAgentWeb目录下执行npm install时同样遇到问题

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: xagent@0.0.0
npm ERR! Found: vue@3.3.4
npm ERR! node_modules/vue
npm ERR! vue@"^3.2.45" from the root project
npm ERR! peer vue@"^2.6.14 || ^3.3.0" from pinia@2.1.7
npm ERR! node_modules/pinia
npm ERR! dev pinia@"^2.0.32" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@">= 2.5 < 2.7" from @vue/composition-api@1.7.2
npm ERR! node_modules/@vue/composition-api
npm ERR! peerOptional @vue/composition-api@"^1.4.0" from pinia@2.1.7
npm ERR! node_modules/pinia
npm ERR! dev pinia@"^2.0.32" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.

log文件
0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
1 info using npm@7.5.2
2 info using node@v12.22.12
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/share/nodejs/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:/home/ys/XAgent/XAgentWeb/.npmrc Completed in 0ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:/root/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 5ms
19 verbose npm-session 669698cc0d4476b8
20 timing npm:load Completed in 11ms
21 timing arborist:ctor Completed in 0ms
22 timing arborist:ctor Completed in 0ms
23 timing idealTree:init Completed in 14ms
24 timing idealTree:userRequests Completed in 0ms
25 silly idealTree buildDeps
26 silly fetch manifest @element-plus/icons-vue@^2.1.0
27 http fetch GET 304 https://registry.npmjs.org/@element-plus%2ficons-vue 807ms (from cache)
28 silly fetch manifest vue@^3.2.45
29 http fetch GET 304 https://registry.npmjs.org/vue 205ms (from cache)
30 silly fetch manifest @types/crypto-js@^4.1.1
31 http fetch GET 304 https://registry.npmjs.org/@types%2fcrypto-js 192ms (from cache)
32 silly fetch manifest element-plus@^2.2.28
33 http fetch GET 304 https://registry.npmjs.org/element-plus 205ms (from cache)
34 silly fetch manifest primevue@^3.34.1
35 http fetch GET 200 https://registry.npmjs.org/primevue 1187ms
36 silly fetch manifest sass@^1.57.1
37 http fetch GET 304 https://registry.npmjs.org/sass 194ms (from cache)
38 silly fetch manifest sass-loader@^13.2.0
39 http fetch GET 304 https://registry.npmjs.org/sass-loader 193ms (from cache)
40 silly fetch manifest fibers@>= 3.1.0
41 http fetch GET 304 https://registry.npmjs.org/fibers 190ms (from cache)
42 silly fetch manifest node-sass@^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0
43 http fetch GET 304 https://registry.npmjs.org/node-sass 190ms (from cache)
44 silly fetch manifest sass-embedded@*
45 http fetch GET 304 https://registry.npmjs.org/sass-embedded 183ms (from cache)
46 silly fetch manifest webpack@^5.0.0
47 http fetch GET 304 https://registry.npmjs.org/webpack 230ms (from cache)
48 silly fetch manifest save@^2.9.0
49 http fetch GET 304 https://registry.npmjs.org/save 181ms (from cache)
50 silly fetch manifest uuid@^9.0.1
51 http fetch GET 304 https://registry.npmjs.org/uuid 194ms (from cache)
52 silly fetch manifest vue-json-viewer@^3.0.4
53 http fetch GET 304 https://registry.npmjs.org/vue-json-viewer 255ms (from cache)
54 silly fetch manifest vue-router@^4.1.6
55 http fetch GET 304 https://registry.npmjs.org/vue-router 197ms (from cache)
56 silly fetch manifest @commitlint/cli@^17.3.0
57 http fetch GET 304 https://registry.npmjs.org/@commitlint%2fcli 244ms (from cache)
58 silly fetch manifest @commitlint/config-conventional@^17.3.0
59 http fetch GET 304 https://registry.npmjs.org/@commitlint%2fconfig-conventional 218ms (from cache)
60 silly fetch manifest @iconify/json@^2.2.14
61 http fetch GET 304 https://registry.npmjs.org/@iconify%2fjson 260ms (from cache)
62 silly fetch manifest @tinymce/tinymce-vue@^5
63 http fetch GET 304 https://registry.npmjs.org/@tinymce%2ftinymce-vue 319ms (from cache)
64 silly fetch manifest @types/markdown-it@^12.2.3
65 http fetch GET 304 https://registry.npmjs.org/@types%2fmarkdown-it 190ms (from cache)
66 silly fetch manifest @types/marked@^4.0.8
67 http fetch GET 304 https://registry.npmjs.org/@types%2fmarked 200ms (from cache)
68 silly fetch manifest @types/node@^18.14.6
69 http fetch GET 304 https://registry.npmjs.org/@types%2fnode 241ms (from cache)
70 silly fetch manifest @types/uuid@^9.0.3
71 http fetch GET 304 https://registry.npmjs.org/@types%2fuuid 193ms (from cache)
72 silly fetch manifest @typescript-eslint/parser@^5.49.0
73 http fetch GET 304 https://registry.npmjs.org/@typescript-eslint%2fparser 374ms (from cache)
74 silly fetch manifest eslint@^8.33.0
75 http fetch GET 304 https://registry.npmjs.org/eslint 203ms (from cache)
76 silly fetch manifest @vitejs/plugin-vue@^4.0.0
77 http fetch GET 304 https://registry.npmjs.org/@vitejs%2fplugin-vue 210ms (from cache)
78 silly fetch manifest vite@^4.0.0
79 http fetch GET 304 https://registry.npmjs.org/vite 230ms (from cache)
80 silly fetch manifest less@*
81 http fetch GET 304 https://registry.npmjs.org/less 228ms (from cache)
82 silly fetch manifest lightningcss@^1.21.0
83 http fetch GET 304 https://registry.npmjs.org/lightningcss 956ms (from cache)
84 silly fetch manifest stylus@*
85 http fetch GET 304 https://registry.npmjs.org/stylus 228ms (from cache)
86 silly fetch manifest sugarss@*
87 http fetch GET 304 https://registry.npmjs.org/sugarss 179ms (from cache)
88 silly fetch manifest postcss@^8.3.3
89 http fetch GET 304 https://registry.npmjs.org/postcss 577ms (from cache)
90 silly fetch manifest terser@^5.4.0
91 http fetch GET 304 https://registry.npmjs.org/terser 189ms (from cache)
92 silly fetch manifest @vueuse/core@^9.12.0
93 http fetch GET 304 https://registry.npmjs.org/@vueuse%2fcore 218ms (from cache)
94 silly fetch manifest axios@^1.3.4
95 http fetch GET 304 https://registry.npmjs.org/axios 573ms (from cache)
96 silly fetch manifest clipboard@^2.0.11
97 http fetch GET 304 https://registry.npmjs.org/clipboard 182ms (from cache)
98 silly fetch manifest cross-env@^7.0.3
99 http fetch GET 304 https://registry.npmjs.org/cross-env 196ms (from cache)
100 silly fetch manifest crypto-js@^4.1.1
101 http fetch GET 304 https://registry.npmjs.org/crypto-js 184ms (from cache)
102 silly fetch manifest dompurify@^3.0.1
103 http fetch GET 304 https://registry.npmjs.org/dompurify 187ms (from cache)
104 silly fetch manifest eslint-plugin-vue@^9.9.0
105 http fetch GET 304 https://registry.npmjs.org/eslint-plugin-vue 191ms (from cache)
106 silly fetch manifest highlight.js@^11.7.0
107 http fetch GET 304 https://registry.npmjs.org/highlight.js 186ms (from cache)
108 silly fetch manifest lint-staged@^13.2.0
109 http fetch GET 304 https://registry.npmjs.org/lint-staged 579ms (from cache)
110 silly fetch manifest markdown-it@^13.0.1
111 http fetch GET 304 https://registry.npmjs.org/markdown-it 191ms (from cache)
112 silly fetch manifest marked@^4.3.0
113 http fetch GET 304 https://registry.npmjs.org/marked 252ms (from cache)
114 silly fetch manifest nanoid@^4.0.1
115 http fetch GET 304 https://registry.npmjs.org/nanoid 187ms (from cache)
116 silly fetch manifest pinia@^2.0.32
117 http fetch GET 304 https://registry.npmjs.org/pinia 190ms (from cache)
118 silly fetch manifest @vue/composition-api@^1.4.0
119 http fetch GET 304 https://registry.npmjs.org/@vue%2fcomposition-api 357ms (from cache)
120 silly fetch manifest vue@>= 2.5 < 2.7
121 timing idealTree Completed in 14256ms
122 timing command:install Completed in 14268ms
123 verbose stack Error: unable to resolve dependency tree
123 verbose stack at Arborist.[failPeerConflict] (/usr/share/nodejs/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1115:25)
123 verbose stack at Arborist.[loadPeerSet] (/usr/share/nodejs/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1095:34)
123 verbose stack at async Arborist.[loadPeerSet] (/usr/share/nodejs/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1073:11)
123 verbose stack at async Arborist.[buildDepStep] (/usr/share/nodejs/@npmcli/arborist/lib/arborist/build-ideal-tree.js:824:11)
123 verbose stack at async Arborist.buildIdealTree (/usr/share/nodejs/@npmcli/arborist/lib/arborist/build-ideal-tree.js:209:7)
123 verbose stack at async Promise.all (index 1)
123 verbose stack at async Arborist.reify (/usr/share/nodejs/@npmcli/arborist/lib/arborist/reify.js:127:5)
123 verbose stack at async install (/usr/share/nodejs/npm/lib/install.js:38:3)
124 verbose cwd /home/ys/XAgent/XAgentWeb
125 verbose Linux 5.10.0-23-amd64
126 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
127 verbose node v12.22.12
128 verbose npm v7.5.2
129 error code ERESOLVE
130 error ERESOLVE unable to resolve dependency tree
131 error
132 error While resolving: xagent@0.0.0
132 error Found: vue@3.3.4
132 error node_modules/vue
132 error vue@"^3.2.45" from the root project
132 error peer vue@"^2.6.14 || ^3.3.0" from pinia@2.1.7
132 error node_modules/pinia
132 error dev pinia@"^2.0.32" from the root project
132 error
132 error Could not resolve dependency:
132 error peer vue@">= 2.5 < 2.7" from @vue/composition-api@1.7.2
132 error node_modules/@vue/composition-api
132 error peerOptional @vue/composition-api@"^1.4.0" from pinia@2.1.7
132 error node_modules/pinia
132 error dev pinia@"^2.0.32" from the root project
132 error
132 error Fix the upstream dependency conflict, or retry
132 error this command with --force, or --legacy-peer-deps
132 error to accept an incorrect (and potentially broken) dependency resolution.
132 error
132 error See /root/.npm/eresolve-report.txt for a full report.
133 verbose exit 1

@ChengFai
Copy link
Contributor

检查一下node和npm版本,node 16以上, 删掉node_modules之后重装 npm install

@ChengFai
Copy link
Contributor

最好能把node升级到20以上

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants