Package-lock deployment issue for Firebase Functions - firebase

I receive a following error despite no package-lock.json, yarn.lock in my dist directory. I use *.tgz files as artifacts of packages in a monorepo. This function was successfully deployed in the past.
{"#type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":3,"message":"Build failed: npm ERR! cipm can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with npm install before continuing.\nnpm ERR! \nnpm ERR! \nnpm ERR! Invalid: lock file's #mycompany/common#1.0.0 does not satisfy #mycompany/common#file:./mycompany-common-v1.0.0.tgz\nnpm ERR! \n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /www-data-home/.npm/_logs/2022-02-22T10_38_22_819Z-debug.log; Error ID: beaf8772"},"authenticationInfo":{"principalEmail":"myemail#gmail.com"},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/my-project/locations/us-central1/functions/nestapi"}

The error indicated package.json and package-lock.json are not in sync. Make sure to remove node_modules, execute npm install.
‘npm install’ would install the dependencies, then you'll have a package-json.lock file and CI won't throw any error.
Alternatively, you may also have a look at this GitHub Link.

Related

EACCES: permission denied when installing an NPM package globally

I need to install firebase tools for firebase hosting. So I review the documentation and I run the command sudo npm install -g firebase-tools but this appears in my terminal.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated xmldom#0.1.31: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm WARN deprecated har-validator#5.1.5: this library is no longer supported /usr/local/bin/firebase -> /usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js
npm ERR! code EACCES
npm ERR! syscall /usr/local/lib
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, acces '/usr/local/lib'
npm ERR! {[Error: EACCES: permission denied, acces '/usr/local/lib']
npm ERR! stack:
npm ERR! 'Error: EACCES: permission denied, acces \'/usr/local/lib\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command as root/Administrator.
This issue is related to permissions and can be resolved by installing a node version manager.
If you see an EACCES error when you try to install a package globally, you can either:
Reinstall npm with a node version manager (recommended),
or
Manually change npm's default directory
This is the best way to avoid permissions issues. To reinstall npm with a node version manager, follow the steps in "Downloading and installing Node.js and npm". You do not need to remove your current version of npm or Node.js before installing a node version manager.

Error 404 when installing dependencies for firebase functions

I'm trying to intall the following
npm install --save express body-parser firebase functions-helper
but I keep receiving these errors
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/functions-helper - Not found
npm ERR! 404
npm ERR! 404 'functions-helper#latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2020-07-13T12_53_21_822Z-debug.log
So far I tried doing this
npm clean cache
upgrade node to latest version but I still get the same errors
It's telling your you are trying to install a package that doesn't exist, I cannot find any package called functions-helper, did you mean firebase-functions-helper
There is no module called "functions-helper". If you are writing Cloud Functions using the Firebase tools, you will need to install the module called "firebase-functions", as described in the documentation.

Firebase functions install failing due to auth

I keep trying to npm install firebase functions. I've done this many times before and this is the first time I am getting this issue. The error is as follows:
PS C:\Users\jacob\Desktop\sultvueweb> npm install firebase firebase/functions
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git#github.com/firebase/functions.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jacob\AppData\Roaming\npm-cache\_logs\2020-04-28T22_58_26_800Z-debug.log
I can't seem to figure out where I need to update my credentials to make this work. Thank you for any help.
My issue was I didn't have an elevated command prompt in my text editor. I tried it in an admin prompt and worked right away. Not sure why it would have given the errors it did.

Cannot start npm after installing react ERR! react-scripts start

While using redux with react. I was trying to do npm start for my app(reactwithredux) after installing react-redux and redux libraries . I see this error below. I'm trying to figure it out myself, but no luck so far. Please help me out.
'react-scripts' is not recognized as an internal or external command,
operable program or batch file. npm ERR! code ELIFECYCLE npm ERR!
errno 1 npm ERR! reactwithredux#0.1.0 start: react-scripts start npm
ERR! Exit status 1 npm ERR! npm ERR! Failed at the
reactwithredux#0.1.0 start script. npm ERR! This is probably not a
problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\preet\AppData\Roaming\npm-cache_logs\2018-09-21T01_19_43_724Z-debug.log
Try following
npm run cache clean --force
rm -rf node_modules (in project
directory)
npm install
If this doesn't solve the error, please provide a link to repo need to take a look at package.json.

npm run build error, no such file or directory, open 'build/bundle.css'

I'm attempting a routine-test of a customized WordPress-installation on a localhost production supported by the node package-manager. After instantiating the WordPress core-files, ensuring successful connection to the database and updating a few assets, I attempted to change-directory into the corresponding WordPress-theme files to run the node-package-manager install command with npm install (which was successful) and then attempted to execute the CSS-compiler with npm run buildas per routine; however, on this attempt, I encountered the following errors within my below terminal output:
vetsi npm run build
> # build /Users/alexsingleton/Sites/vetsi/wp-content/themes/vetsi
> npm-run-all --silent compile:css compile:js
/Users/alexsingleton/Sites/vetsi/wp-content/themes/vetsi/node_modules/stylus/bin/stylus:715
if (err) throw err;
^
Error: ENOENT: no such file or directory, open 'build/bundle.css'
at Error (native)
ERROR: compile:css: None-Zero Exit(1);
npm ERR! Darwin 16.4.0
npm ERR! argv "/Users/alexsingleton/.nvm/versions/node/v4.4.4/bin/node" "/Users/alexsingleton/.nvm/versions/node/v4.4.4/bin/npm" "run" "build"
npm ERR! node v4.4.4
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # build: `npm-run-all --silent compile:css compile:js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # build script 'npm-run-all --silent compile:css compile:js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm-run-all --silent compile:css compile:js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/alexsingleton/.npm/_logs/2017-02-15T17_48_20_907Z-debug.log
➜ vetsi
I've tried updating both the node package manager with npm install -g npm and verified the correct version corresponding to another successful localhost production with nvm ls generating the below output:
vetsi nvm ls
v0.12.7
-> v4.4.4
system
default -> 4.4.4 (-> v4.4.4)
node -> stable (-> v4.4.4) (default)
stable -> 4.4 (-> v4.4.4) (default)
iojs -> iojs- (-> N/A) (default)
➜ vetsi
Needless to say, the above-errors preclude any localhost pages from rendering, though I can successfully access and navigate within the WordPress Content Management system. I would appreciate any guidance- thank you!
After investigating the localhost-production within the console of Google Chrome Inspector Tools, the error reported that the entire node package-manager folder and dependencies were missing. Since neither npm-install nor npm build didn't instantiate the package-folder or dependencies, I simply copied the files from my other working localhost production, specifically bundle.css where it was apparently missing from the appropriate path (wp/themes/vetsi/build). For now, this hack is the best solution to my problem but I welcome alternative analysis or clarification as to why the aforementioned commands didn't correctly execute according to my previous successes. Thanks!

Resources