Agung
Agung

Reputation: 13813

can't install npm package in google cloud functions

I am new in using google cloud functions. I am trying to use expressjs in the my google cloud functions folder. I run npm i express on my terminal. but I get errors like this

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.

+ [email protected]
updated 1 package and audited 17547 packages in 4.294s

it seems the package is installed, but the express dependecies is not automatically added on package.json

enter image description here

Upvotes: 1

Views: 815

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317497

Change directory (cd) to your functions folder before running the command. npm assumes that package.json is in the current working directory in order to make changes to it.

Upvotes: 2

Related Questions