我在我当前正在进行的 Laravel 项目中安装了带有 npm 的 vue,以使用 vue.js 框架学习前端开发。
安装后,教程说我需要运行 npm run dev
才能看到我在 ../resources/js/components/Posts/Index.vue
和 ../resources/js/components/app.js
中所做的更改,运行 npm run dev
后我得到了这个完整的日志我无法想清楚发生了什么问题。
0 verbose cli [
0 verbose cli 'D:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Users\\Gediminas\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'run',
0 verbose cli 'watch'
0 verbose cli ]
1 info using npm@7.5.3
2 info using node@v14.15.1
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:C:\Users\Gediminas\AppData\Roaming\npm\node_modules\npm\npmrc Completed in 3ms
5 timing config:load:builtin Completed in 3ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:D:\Users\Gediminas\Desktop\Laravel\laravel-bookshop\.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:C:\Users\Gediminas\.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:C:\Users\Gediminas\AppData\Roaming\npm\etc\npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 1ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 9ms
19 verbose npm-session 8f60d8cb01406e13
20 timing npm:load Completed in 17ms
21 timing command:run-script Completed in 660ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess.<anonymous> (C:\Users\Gediminas\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
22 verbose stack at ChildProcess.emit (events.js:315:20)
22 verbose stack at maybeClose (internal/child_process.js:1048:16)
22 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
23 verbose cwd D:\Users\Gediminas\Desktop\Laravel\laravel-bookshop
24 verbose Windows_NT 10.0.18363
25 verbose argv "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Gediminas\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
26 verbose node v14.15.1
27 verbose npm v7.5.3
28 error code 1
29 error path D:\Users\Gediminas\Desktop\Laravel\laravel-bookshop
30 error command failed
31 error command C:\Windows\system32\cmd.exe /d /s /c mix watch
32 verbose exit 1
答案 0 :(得分:0)
请先运行 npm update
,然后运行 npm run dev
。
答案 1 :(得分:0)
删除 node_modules
文件夹并运行 npm install
或 yarn install
。