Synk: self signed certificate in certificate chain - javascript

I've just started to have Synk Protect throw "self signed certificate in certificate chain" when I run npm install on a project of mine. Can anyone give me some pointers on how I find which of the 984 packages in my project is causing this error?
> eslint-config-adjunct#4.8.11 snyk-protect /Users/dave.bradshaw/dev/eslint-config-adjunct
> snyk protect
self signed certificate in certificate chain
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! eslint-config-adjunct#4.8.11 snyk-protect: `snyk protect`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the eslint-config-adjunct#4.8.11 snyk-protect script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Run the following:
sudo npm install --unsafe-perm binding

Related

NPM ERR NPM INSTALL

I am getting below error while executing npm install in one of my project :
pm ERR! Error while executing:
npm ERR! C:\Program Files\Git\bin\git.EXE ls-remote -h -t https://github.com/pocketjoso/css.git
npm ERR!
npm ERR! fatal: unable to access 'https://github.com/pocketjoso/css.git/': SSL certificate problem: self signed certificate in certificate chain
npm ERR!
npm ERR! exited with error code: 128
Could you please help me here ?
Thanks,
Gagan
I have tried after deletion of previous node_modules folder and package-lock.json both. Still, the issue is same.

npm install errors out preinstall script

I needed to fix security vulnerabilities for knexnest > knex > minimist. The version for minimist did not get updated with npm audit fix or simple npm update. I followed this article and it updated the versions and gave a vulnerability score of 0. But now when I create a docker image (build) my repo, it fails at the preinstall script.
npx: installed 5 in 5.29s
EACCES: permission denied, open './package-lock.json'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-service#1.2.3 preinstall: `npx npm-force-resolutions`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-service#1.2.3 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /home/node/.npm/_logs/2020-07-15T09_56_56_625Z-debug.log
While installing modules locally on editor, no errors pop up. Please help!
I had the same error, I fixed it with
chmod 666 package-lock.json
This doesn't seem as a root cause solution, but it's a simple workaround.

I am new to this and having issue while runing the java script

Can someone help. I am completely new to this but when I am running the script I am getting below error. if someone can teach me or help me it would be a great help
functions# deploy /Users/kapilgaur/Downloads/React-Native-APP-master/functions
firebase deploy --only functions
sh: firebase: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! functions# deploy: `firebase deploy --only functions`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the functions# deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kapilgaur/.npm/_logs/2020-03-05T13_09_05_478Z-debug.log
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
run this in your terminal
alias firebase="`npm config get prefix`/bin/firebase"
or you just install firebase tool globally
npm install -g firebase-tools
either of them should do the trick,

Bcrypt refuses to install; no fixes have worked yet

This has been months worth of troubleshooting. I cannot npm install bcrypt no matter what I try.
I've tried sudo npm install bcrypt, brew install bcrypt, uninstalling node and reinstalling node, copying bcrypt files and editing my json files... Nothing works. Tested with alternatives to bcrypt, such as bcryptjs. This is only a problem with bcrypt packages, and I have tried dozens of suggestions and solutions I've found online to no avail.
Brew tells my bcrypt is installed, so I uninstall it through brew and it says it is still installed. I've done npm uninstall bcrypt -g just in case, but it still doesn't work. It says I don't have access to my node_modules folder, but, again, this only happens with bcrypt and literally nothing else. Express, postgresql, cors, body-parser, react, redux, thunk... Everything else installs and works without any issue.
npm WARN checkPermissions Missing write access to /Users/someUser/Desktop/realtorSite/server/node_modules
npm WARN server#1.0.0 No description
npm WARN server#1.0.0 No repository field.
npm ERR! path /Users/someUser/Desktop/realtorSite/server/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/someUser/Desktop/realtorSite/server/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/Users/someUser/Desktop/realtorSite/server/node_modules'] {
npm ERR! stack: 'Error: EACCES: permission denied, access ' +
npm ERR! "'/Users/someUser/Desktop/realtorSite/server/node_modules'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/Users/someUser/Desktop/realtorSite/server/node_modules'
npm ERR! }
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 again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/someUser/.npm/_logs/2019-06-16T22_38_43_256Z-debug.log
I just want to figure out what is wrong and be able to regularly use bcrypt and other encryption-based packages.
https://lightrains.com/blogs/fixing-npm-permissions-install-global
This link is how I fixed my issue. First, I used npm config get prefix to find my npm directory and cd ~ to get to my root directory. I then ran ls -a and found a node_modules folder in my root. By using ls -la node_modules, I found root was given all permissions by I had no rights. sudo chown -R someUser node_modules changed all permissions inside of node_modules to someUser instead of root.
Tested npm install bcrypt and it installs without issue.

create-react-app newproject commandline is not working for me

for some reason ive been ending up with "command not found" when i type in the create-react-app newproject command. Its been giving me this error:
npm WARN checkPermissions Missing write access to /Users/kennyquach/.npm-global/lib/node_modules/create-react-app
npm ERR! path /Users/kennyquach/.npm-global/lib/node_modules/create-react-app
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/kennyquach/.npm-global/lib/node_modules/create-react-app'
npm ERR! { Error: EACCES: permission denied, access '/Users/kennyquach/.npm-global/lib/node_modules/create-react-app'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/Users/kennyquach/.npm-global/lib/node_modules/create-react-app\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/Users/kennyquach/.npm-global/lib/node_modules/create-react-app' }
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 again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kennyquach/.npm/_logs/2018-11-28T17_50_32_739Z-debug.log
any help is appreciated! Thanks!
As the error clearly shows you dont have write access to /Users/kennyquach/.npm-global/lib/node_modules/create-react-app
try changing access to 777 for all of .npm-global folders and then give a try.
You are high likely using Mac OS as Operating System. This is a general issue of globally installed packages in MacOS that caused by built-in node application's file permissions. Actually you can get over this by executing create-react-app as root, but i don't recommend that, it's not useful and it's risky.
So you got 2 options. (First one is hard to do, second is blazing fast)
1-) Completely remove Node from your System and install it with Brew. You can easily update node with that package manager and install any other popular developer tools too (Like: mongodb, mysql, pgsql, rabbitmq etc.).
You can get brew from here: https://brew.sh and install node with that code: brew install node
2-) You can easily give read, write, execute access to your folders and files. You can do it like this: sudo chmod -R 777 /Users/kennyquach/.npm-global/ when sudo asks your password, use your Administrator password.
This looks like an access issue. I faced same issue in MAC OS X, when I tried running the command with sudo, it worked for me.
sudo npm install -g create-react-app

Categories

Resources