npm init install project within /home/myUser folder on ubuntu 14 - node.js

I'm using Ubuntu 14.04 and I've installed nodejs v5.1.0 via nvm, and npm v3.3.12. I also installed yeoman with some generators. However, if I try to init a new project (via npm init or yo some-generator), all the files and "node_modules" folder are installed into /home/myUser, without errors. Even if I start a new project into a different directory. I don't know how do configure this.
Can anyone help with this issue please??

I think your issues are permission npm:
Install npm with global: sudo npm install -g npm
Set full permission for npm: sudo chown -R $USER ~/.npm

Related

npm install issues - react native project - mac

I am trying to clone a remote react-native project but I am getting errors when running the npm install command to download all the dependencies in the package.json folder.
I am in the same root directory where the package.json file is.
This is what I get when running npm install:
when I try doing npm install --force or npm install --legacy-deps I get:
I've tried uninstalling node reinstalling to the LTS and current version.
This is the process I followed when trying to install the dependencies:
clone remote repo
npm init
npm install
I am not quite sure what else to do any help would be greatly appreciated.
First you need to get in project directory then install the node packages
cd <ProjectName>
npm install

How to update NPM 6.13.4 to 7.16.0 on Mac?

I'm studying Laravel, and after I run the command npm run dev, I saw these messages:
New major version of npm available! 6.13.4 → 7.16.0
Changelog: https://github.com/npm/cli/releases/tag/v7.16.0
Run npm install -g npm to update!
But when I run the command: npm install -g npm on terminal, I get a lot of messages about permissions:
The command sudo chown -R 501:20 "/Users/myfolder/.npm" doesn't change anything. I tried to clear the cache with:
npm cache clean --force
Still nothing.
I don't know much about npm and I have this problem on my mac for a long time, since I can't find a way to solve this. I don't even know how to completely remove npm/node. So, I'm pretty stuck.
Can anyone please help me?
npm install -g npm#latest
Install latest version
Permission problem solve
sudo chown -R user:group folder
sudo chmod -R 755 folder
or
sudo npm install -g npm#latest

sudo npm install command not found

I have installed nodejs and npm in my server (os:amazon ami) using node version manager
current node version is 7.10.0
npm version is 4.2.0
nodejs project is located in var/www/testing folder when i am trying to install the depeondeies present in package.json using sudo npm install i got command not found error
Path of node and npm is respectively
~/.nvm/versions/node/v7.10.0/bin/node
~/.nvm/versions/node/v7.10.0/bin/npm
npm and node are in same folder but when I try this command:
sudo npm install I got sudo: npm: command not found
npm install command throws no errors but node_modules folder is empty.
Correct npm path is /usr/local/bin/npm else just run below command again
sudo apt-get install npm
And verify the npm is install, Alternatively you can try:
sudo ln -s /usr/local/lib/node /usr/lib/node
sudo ln -s /usr/local/bin/npm /usr/bin/npm
I got this error when I tried to install npm.
bash-3.2$ sudo npm install
sudo: npm: command not found
So, I downloaded node.js from https://nodejs.org/en/
It will automatically set at the required path.
After installation, it worked for me.
Try To Install Node Using Nvm Node Version Manager
From Officai NVM Git Hub Repo
https://github.com/nvm-sh/nvm
git clone https://github.com/nvm-sh/nvm
cd nvm
./installer.sh
nvm install <AnyNodeVersion>
Now Hit Command Line
This Method Actually Worked For ME
i Face same Issue And Explained It Here
https://stackoverflow.com/questions/67285266/npmcommand-not-found-node-v-is-working-but-for-npm-command-not-found

NPM Install is not installing dependencies

I'm attempting to install the Ushahidi V3 Client. I've been following the install process up until when I need to build the project from the source repo using npm and gulp - both of which I've had zero experience with. Whenever I run sudo npm install in the project directory, the process runs without complaints. However, when I run npm ls to verify that dependencies have been downloaded, I get a bunch of dependencies listed out as being missing.
How do I get npm to resolve all of these dependencies?
System Details
OS Ubuntu 14.04 (Trusty)
Node JS v0.12.9
NPM v3.5.1
What I've tried
Removing node_modules folder and re-running sudo npm install as referenced in this SO answer for a similar question: npm Gulp dependencies missing, even after running npm install
Uninstalling and reinstalling node and npm
#Strainy, as your research :D
It was a combination of running as sudo and not having the build-essentials.
That's why you should not use sudo npm
Follow these steps:
try npm uninstall. and then try npm install.
Also If it still doesn't work.
Try:
npm install -g npm-install-missing
or
npm-install-missing
For further reading, click here.

sudo npm fails, env: node: No such file or directory

After uninstalling and reinstalling node and npm I can no longer run npm as sudo. This is on a Mac. I have tried the official node installer and brew.
It works from my user but any attempt to run sudo npm produces this error:
$ sudo npm
env: node: No such file or directory
npm most likely is installed at /usr/local, but /usr/local is not on the $PATH of the root user. You can configure sudo to allow the $PATH to be changed, but if you installed npm with Homebrew you shouldn't have to use sudo at all.

Resources