"npm install express-react-views" result in access error - node.js

I want to install express-react-views in Ubuntu 14.04 locally(not globally) but the installation results in an access error--it is trying to access global npm folder.
Anything I have done wrongly or express-react-views requires sudo privilege?

Related

Create vue Permission denied

I'm trying to install vue app using this command "npm init vue#latest",
But the following error occurred with me, any help :(
Note : I tried many solutions like : chmod -R 755 .npm and sudo chown -R mostafa .npm but nothing changes
maybe you could try using the vue-cli like this:
npm install -g #vue/cli && vue create hello-world
If this wouldn't work then I'd suggest to reinstall node/npm
You should probably also make a clean installation of these tools so that you don't need to run such things as administrator
In order to install vue on your machine you must first have installed nodejs ( package manager node package manager ) to which the acronym npm refers, I leave you the linux commands under :
install :
sudo apt install nodejs
shows the installed version of nodejs :
node -v
After installing nodejs try relaunching the command to install vue
if you have already installed them try with this :
add write permissions to the study folder , and not to the mostafa folder , linux only assigns permissions to the folder in the chmod command and not subfolders, try these commands :
cd home/mostafa/Dowloads
sudo chmod ugo+w study
Are you not being blocked by SELinux directives?
Try running the same command using your least privileged user (normal user).
And please avoid using the root user for everyday tasks.
You need to have installed Nodejs, vue and create-vue.
sudo apt install nodejs
npm install vue#latest
npm install create-vue#latest
Now you can run the command to start the new project with Vue.
npm init vue#latest

npm command in VM

I have successfully installed the version of nodejs 14.18 in both in my host machine and VM. After some troubleshooting I manage to make javascripting work in my host machine however when I type javascripting in VM, it says command not found.
ERROR Message
anyone know why this message is displayed any help would be appreciated
I use vagrant as VM and it is required.
npm install -g javascripting attempts to install the module globally, which requires sudo elevation.
If you just want to install the module locally, run npm install javascripting without the -g parameter

Not able to install #angular/cli

I am getting errors while installing anuglar cli. I am working on the system which I don't have admin rights to. So, I followed below link to install node & npm & correct node & npm version is displayed in command prompt.
Install NodeJS & NPM without admin access
This is the error I am getting while installing angular cli. I have tried many options from previous SO answers but nothing worked. I have given explicit full control to the myself on C:\NodeJS\NodeJS folder. What are the options now?
One workaround would be to switch to a directory you have rights to and run the installation command without the -g flag.
C:\Users\user>cd C:\npm-global
C:\npm-global>npm cache clean --force
C:\npm-global>npm install #angular/cli
And add the bin folder of node_modules to the user environment variable PATH.

Npm getting permission errors

when I try to globally install any modules, I receive the following error...
[Bot (9)] npm install -g miscord
/home/myhome/nodevenv/Bot/9/bin/npm: line 14: /bin/ln: Permission denied
I can install locally, and from what I understood there is no ln folder or script, additionally, it's not writing the miscord folder or files. I am running Nodejs in an environment where I do not have root permissions however it is setup via CPanel, Nodenv and with ssh access. I have tried a few different modules all giving me the same error.
Try to set your specific permissions for npm sudo npm -g config set user YourUser https://docs.npmjs.com/cli/config.html

Yeoman Permission issue in vagrant when installed globally

Today I started with exploring yeoman. I am using Vagrant with a clean Ubuntu 12.04 box. The box is provisioned using this gist that I created and update with the steps I am performing inside vagrant.
So I have installed node globally. When I create a new map ~/yo-demo && cd yo-demo and then type yo I get to see yeoman. But I try to install a generator I get a error:
[Error: EACCES, mkdir '/usr/lib/node_modules/generator-webapp']
This is because node_modules is not vagrant's but it's a root (user) folder. So I can fix this with sudo chown -R vagrant:vagrant /usr/lib/node_modules. But I am not sure if this is the best thing to do.
Is there another way of fixing this? I think I could install it locally, but then again I can't use the yo command from within any folder (That's what I read, but not sure? I havent tested it).
I am soon going to have a VPS and while I wont install yo on there I would probably install other things like node. What would be the preferred location on a vps? Locally or globally?

Resources