我是使用Google云功能的新手。我正在尝试在我的Google云函数文件夹中使用expressjs。我在终端上运行npm i express
。但我收到这样的错误
npm WARN saveError ENOENT: no such file or directory, open '/Users/muchammadagunglaksana/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/muchammadagunglaksana/package.json'
npm WARN muchammadagunglaksana No description
npm WARN muchammadagunglaksana No repository field.
npm WARN muchammadagunglaksana No README data
npm WARN muchammadagunglaksana No license field.
+ express@4.17.1
updated 1 package and audited 17547 packages in 4.294s
似乎已安装软件包,但表达的依赖关系并不会自动添加到package.json
答案 0 :(得分:0)
在运行命令之前,将目录(cd
)更改为functions文件夹。 npm假定package.json在当前工作目录中,以便对其进行更改。