gpt4 book ai didi

node.js - 无法运行 npm install

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

here它说要运行 npm install,但当我运行 sudo npm install 时,我收到此错误。

sudo npm install
npm WARN enoent ENOENT: no such file or directory, open '/var/www/html/mg/package.json'
npm WARN mg No description
npm WARN mg No repository field.
npm WARN mg No README data
npm WARN mg No license field.

没有 sudo:

npm install
npm WARN enoent ENOENT: no such file or directory, open '/var/www/html/mg/package.json'
npm WARN mg No description
npm WARN mg No repository field.
npm WARN mg No README data
npm WARN mg No license field.
npm ERR! Linux 4.4.0-59-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! path /var/www/html/mg/node_modules/.staging
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/var/www/html/mg/node_modules/.staging'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/var/www/html/mg/node_modules/.staging']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/var/www/html/mg/node_modules/.staging' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/mg/npm-debug.log

最佳答案

您需要有一个 package.json 文件才能正常工作。

您可以通过运行来创建它:

npm init

另请参阅:

关于node.js - 无法运行 npm install,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41895459/

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