繁体   English   中英

使用“npm init”命令制作 package.json 时出错

[英]Error when making package.json using 'npm init' command

运行npm init创建package.json文件时出现以下错误:

 0 info it worked if it ends with ok 1 verbose cli [ 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' 1 verbose cli ] 2 info using npm@6.12.0 3 info using node@v12.13.0 4 silly package data { 4 silly package data name: 'mangabackend', 4 silly package data version: '1.0.0', 4 silly package data description: '', 4 silly package data main: 'index.js', 4 silly package data scripts: { test: 'echo "Error: no test specified" && exit 1' }, 4 silly package data author: 'vansh', 4 silly package data license: 'ISC' 4 silly package data } 5 info init written successfully 6 verbose stack Error: EPERM: operation not permitted, open 'C:\\Program Files\\nodejs\\mangabackend\\MangaBackEnd\\package.json' 7 verbose cwd C:\\Program Files\\nodejs\\mangabackend\\angaBackEnd 8 verbose Windows_NT 10.0.17763 9 verbose argv "C:\\\\Program Files\\\\nodejs\\\\node.exe" "C:\\\\Program Files\\\\nodejs\\\\node_modules\\\\npm\\\\bin\\\\npm-cli.js" "init" 10 verbose node v12.13.0 11 verbose npm v6.12.0 12 error code EPERM 13 error syscall open 14 error path C:\\Program Files\\nodejs\\mangabackend\\MangaBackEnd\\package.json 15 error errno -4048 16 error Error: EPERM: operation not permitted, open 'C:\\Program Files\\nodejs\\mangabackend\\MangaBackEnd\\package.json' 16 error [Error: EPERM: operation not permitted, open 'C:\\Program Files\\nodejs\\mangabackend\\MangaBackEnd\\package.json'] { 16 error stack: "Error: EPERM: operation not permitted, open 'C:\\\\Program Files\\\\nodejs\\\\mangabackend\\\\MangaBackEnd\\\\package.json'" 16 error errno: -4048, 16 error code: 'EPERM', 16 error syscall: 'open', 16 error path: 'C:\\\\Program Files\\\\nodejs\\\\mangabackend\\\\MangaBackEnd\\\\package.json' 16 error } 17 error The operation was rejected by your operating system. 17 error It's possible that the file was already in use (by a text editor or antivirus), 17 error or that you lack permissions to access it. 17 error 17 error If you believe this might be a permissions issue, please double-check the 17 error permissions of the file and its containing directories, or try running 17 error the command again as root/Administrator. 18 verbose exit [ -4048, true ]

我是菜鸟,我不知道该怎么办。 请帮我。

我不知道这些错误意味着什么,我只想创建一个package.json

这是一个permission问题,请给予complete permissions

错误:EPERM:不允许操作,打开'C:\\Program Files\\nodejs\\mangabackend\\MangaBackEnd\\package.json'

此错误意味着您无法在MangaBackEnd folder创建package.json文件

C:\\ProgramFiles\\nodejs\\mangabackend\\MangaBackEnd

您可以查看此链接此链接,了解如何在windows授予权限

(或者)

您可以使用Administrator打开命令提示符,也可以这样做。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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