简体   繁体   中英

Nodejs nuxt project setup failed

when I tried to set up a Nuxt project, it failed: command "cretae-nuxt-app" not found

npm ERR! code 1
npm ERR! path C:\Users\tobia\Documents\Code\Web
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c C:\Users\tobia\AppData\Local\Temp\npx-b9ad041f.cmd

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\tobia\AppData\Local\npm-cache\_logs\2022-10-14T18_41_29_925Z-debug-0.log

cmd error

命令错误

which is strange, because it worked before flawlessly.

The full error log is:

1 info using npm@8.15.0
2 info using node@v16.17.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 3ms
6 timing config:load:builtin Completed in 4ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:C:\Users\tobia\Documents\Code\Web\.npmrc Completed in 0ms
10 timing config:load:project Completed in 3ms
11 timing config:load:file:C:\Users\tobia\.npmrc Completed in 1ms
12 timing config:load:user Completed in 1ms
13 timing config:load:file:C:\Users\tobia\AppData\Roaming\npm\etc\npmrc Completed in 1ms
14 timing config:load:global Completed in 1ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:credentials Completed in 2ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 16ms
19 timing npm:load:configload Completed in 17ms
20 timing npm:load:mkdirpcache Completed in 1ms
21 timing npm:load:mkdirplogs Completed in 1ms
22 verbose title npm init nuxt-app test
23 verbose argv "init" "nuxt-app" "test"
24 timing npm:load:setTitle Completed in 1ms
25 timing config:load:flatten Completed in 3ms
26 timing npm:load:display Completed in 4ms
27 verbose logfile logs-max:10 dir:C:\Users\tobia\AppData\Local\npm-cache\_logs
28 verbose logfile C:\Users\tobia\AppData\Local\npm-cache\_logs\2022-10-14T18_41_29_925Z-debug-0.log
29 timing npm:load:logFile Completed in 7ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 32ms
33 silly logfile start cleaning logs, removing 2 files
34 silly logfile done cleaning log files
35 timing arborist:ctor Completed in 1ms
36 http fetch GET 200 https://registry.npmjs.org/create-nuxt-app 869ms (cache revalidated)
37 timing arborist:ctor Completed in 0ms
38 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
39 timing command:init Completed in 1285ms
40 verbose stack Error: command failed
40 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:63:27)
40 verbose stack     at ChildProcess.emit (node:events:513:28)
40 verbose stack     at maybeClose (node:internal/child_process:1093:16)
40 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
41 verbose cwd C:\Users\tobia\Documents\Code\Web
42 verbose Windows_NT 10.0.22000
43 verbose node v16.17.0
44 verbose npm  v8.15.0
45 error code 1
46 error path C:\Users\tobia\Documents\Code\Web
47 error command failed
48 error command C:\Windows\system32\cmd.exe /d /s /c C:\Users\tobia\AppData\Local\Temp\npx-b9ad041f.cmd
49 verbose exit 1
50 timing npm Completed in 1451ms
51 verbose code 1
52 error A complete log of this run can be found in:
52 error     C:\Users\tobia\AppData\Local\npm-cache\_logs\2022-10-14T18_41_29_925Z-debug-0.log

I have already reinstalled NodeJS, which is the latest LTS version (v16.17.0) and I can't find the problem.

With npx create-nuxt-app my-cool-app it is only command not found:

no error message with npx

npx 没有错误消息

der befehl "create-nuxt-app " ist entweder falsch geschrieben oder konnte nicht gefunden werden

meaning

the command "create-nuxt-app" is either misspelled or could not be found

I hed the same issue couple days ago, and what solved my problem was to install the actual "create-nuxt-app" script, like this:

npm i -g create-nuxt-app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM