gpt4 book ai didi

node.js - npm init 错误 - 无法创建应用程序

转载 作者:太空宇宙 更新时间:2023-11-04 02:04:08 25 4
gpt4 key购买 nike

NodeJS 全新

当尝试创建新应用程序时,出现以下情况:它不会创建,而是在该位置退出并显示错误日志

H:\app>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg> --save` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
name: (app)

H:\app>

错误日志内容:

0 info it worked if it ends with ok
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 'init' ]
2 info using npm@3.10.10
3 info using node@v6.11.0
4 verbose stack Error: read EINVAL
4 verbose stack at exports._errnoException (util.js:1018:11)
4 verbose stack at TTY.onread (net.js:568:26)
5 verbose cwd H:\app
6 error Windows_NT 6.1.7601
7 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "init"
8 error node v6.11.0
9 error npm v3.10.10
10 error code EINVAL
11 error errno EINVAL
12 error syscall read
13 error read EINVAL
14 error If you need help, you may report this error at:
14 error <https://github.com/npm/npm/issues>
15 verbose exit [ 1, true ]

非常感谢任何帮助!

最佳答案

尝试此命令:npm init - y

默认情况下,上面的命令将在当前目录创建一个默认的package.json。似乎访问方面存在一些问题。创建默认的 package.json 文件后,您可以稍后更新它。

关于node.js - npm init 错误 - 无法创建应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44934121/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com