Error during now-cli installation

Nithin21
Tera Expert

Operating System :

Ubuntu

 

Followed the steps in Developer site 

1. Install Node.js v12.x using npm manager

# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

2. Validate node js and npm are available.

3. Install Now-Cli . 

npm install --global @servicenow/cli@orlando

I received the below error.

Understand that installation does not have read / write permission to the mentioned folder. 

I am unable to find the mentioned folder in my laptop to provide the permission. 

npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/@servicenow/cli/src/index.js
npm ERR! dest /usr/bin/tectonic
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/@servicenow/cli/src/index.js' -> '/usr/bin/tectonic'
npm ERR!  [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/@servicenow/cli/src/index.js' -> '/usr/bin/tectonic'] {
npm ERR!   cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/@servicenow/cli/src/index.js' -> '/usr/bin/tectonic'] {
npm ERR!     errno: -13,
npm ERR!     code: 'EACCES',
npm ERR!     syscall: 'symlink',
npm ERR!     path: '../lib/node_modules/@servicenow/cli/src/index.js',
npm ERR!     dest: '/usr/bin/tectonic'
npm ERR!   },
npm ERR!   stack: "Error: EACCES: permission denied, symlink '../lib/node_modules/@servicenow/cli/src/index.js' -> '/usr/bin/tectonic'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/@servicenow/cli/src/index.js',
npm ERR!   dest: '/usr/bin/tectonic'
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.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nithin/.npm/_logs/2020-04-24T16_00_22_226Z-debug.log
1 ACCEPTED SOLUTION

jeff_foltz
Kilo Expert

This error is before now-cli is installed.  Your system may not like installing now-cli globally. 

Take a look at https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally .  

I believe live coding happy hour ran into the same issue https://www.youtube.com/watch?v=57kbG-dRxJ4 

Also, take a look the recap for their videos for some more links and information.  https://developer.servicenow.com/blog.do?p=/post/orlando-components-lchh-recap/

View solution in original post

5 REPLIES 5

Anil Shewale
Mega Guru

Hi

check that the ServiceNow instance version for the host specified could  validated or not. You will need to confirm that your instance is running Orlando. Running now-cli commands such as deploy on a non-Orlando instance is supported or not.

refer the following link it might help you.

https://developer.servicenow.com/dev.do#!/guide/orlando/now-experience/cli/faq

 

If it help mark helpful or correct 

Thanks and regards

Anil

jeff_foltz
Kilo Expert

This error is before now-cli is installed.  Your system may not like installing now-cli globally. 

Take a look at https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally .  

I believe live coding happy hour ran into the same issue https://www.youtube.com/watch?v=57kbG-dRxJ4 

Also, take a look the recap for their videos for some more links and information.  https://developer.servicenow.com/blog.do?p=/post/orlando-components-lchh-recap/

Interestingly when i try it in Visual Studio Code , it works. 

Before, when i posted the question, i was trying in cmd prompt in windows machine.

Ashish Kumar S2
Tera Contributor

Just prepend sudo to the command i.e sudo npm install @servicenow/cli -g. that should solve the issue. It is required to run commands that required admin priveleges.

Wiki : https://en.wikipedia.org/wiki/Sudo