Jhipster "com.github.erslett:frontend-maven-plugin:1.11.3:npm" goal failed - jhipster

I'm trying to run a "mvn clean package". I've got an error that saying it cannot run "[my_project_path]\target\node\node.exe" because I need some permissions that I don't have.
jHipster error
I have a Node installation elsewhere on the disk and I want to know if it possible to setup the Node.exe used.

Did you check this?
https://www.npmjs.com/package/npm-check-updates
Try to update your packages version.
npm install -g npm-check-updates (to check the current nd update versions of all)
ncu -u (to update)
npm install

Related

How to update my Project with my new NPM version?

How are you all?
I'm really new at this. I'm having trouble deploying my react project. When I do it, the entire website is blank. Someone said to me that I should update my Node and my NPM. That leads me to the first question: "When I update the NPM, I'm updating Node at the same time, right?"
So I researched and found this command:
npm cache clean -f
sudo npm install -g n stable
And I think that updated my NPM.
Done that, I ran the GIT STATUS to see if something were modified in my project. Nothing.
But that leads me to my second question: "Cool... but now I have to update my project with my new NPM version, right?"
I tried:
NPM UPDATE
But then i checked my git status again and nothing was modified. How can I update it?
Thanks guys. I really hope I did this right.
First of all, you have to understand npm & node is the environment to run the projects on your computer (local). It's global and not belong to any project. So if you install or update global, it won't affect your project (specific on your working copy git) because it's the global, and only is the environment to run, you can check dependencies on your package.json file.
If you wanna update node to latest:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
update npm to latest version: npm install npm#latest -g

Install Yarn after NPM

I need some help and clarification regarding Yarn installation process.
MacOS ver. 10.14.2
I've installed Homebrew via official site (ver. 2.0.1).
I've installed NPM by downloading package from official site (ver. 10.15.1 LTS).
Now when I tried to install yarn via brew install yarn
I have the following error:
The post-install step did not complete successfully
You can try again using `brew postinstall node`
As I undertand, NPM installs node locally, when, for instance, I try to use create-react-app. When I use Homebrew to install yarn, it tries to install node globally. And we have conflict here.
I've found suggestion to use:
sudo chown -R `whoami`:admin /usr/local/
I am not entirely sure what this command does.
So, the questions are:
Why changing the owner of the folder should be a solution? How will it affect multi user system?
What is the correct way to install yarn?
Can be there any conflicts if node is installed globally and locally (app folder.)
P.S. Please correct me, if I have wrong understanding here.
As Trott points out, npm does not install Node. npm is a package manager that comes bundled with Node. If you install Node, you automatically install npm.
Why changing the owner of the folder should be a solution? How will it affect multi user system?
It's not. Changing the permissions of this folder is sometimes suggested as a workaround for when you have npm installed in a location owned by root. This can cause EACCES errors when you try to install packages globally.
What is the correct way to install yarn?
While you can install Yarn through the Homebrew package manager, I would recommend doing: npm install -g yarn.
Can be there any conflicts if node is installed globally and locally (app folder).
You can't install Node globally and locally. You can install multiple versions of Node on the same machine, however.
I'm not a big fan of having one global Node installation, as it makes it a pain to update (esp. if one application relies on an older version of Node) and, depending on how you install Node, it can lead to permissions errors.
The better way is to use a version manager. This will allow you to install multiple Node versions on your machine, avoid permissions errors and swap between these Node versions at will.
I would recommend using nvm. It works nicely on MacOS. The TL;DR for installing nvm is:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
But I would encourage you to look at the project on GitHub and read its README. There is also a good tutorial on how to use it here.
Once you have Node installed using nvm, run npm install -g yarn to install Yarn globally and you should be off to the races.
Finally, you might want to read this tutorial on using npm, as it could help to clear up some of the concepts.
HTH
I have faced a problem after install yarn by running npm install -g yarn command in my OS Windows 10 Pro. That was showing yarn' is not recognized as an internal or external command operable program or batch file.
Whatever, I have found the solution:
After npm,
go to CMD from your windows PC,
write : *npm install -g yarn*
then,
Go to Environmental Variables set up.
Edit Path and add new and paste:
C:\Users\User\AppData\Roaming\npm\node_modules\yarn\bin\
Restart your terminal. And then check again in your cmd by running :
*yarn* or *yarn --version*

The preferred way of installing and using global npm packages?

To install a package globally, one has to use sudo, but then again npm does not recommend using sudo. So the official recommendation is this. I followed all the steps from 1 to 5 in Option 2. But when I want to use an NPM package from terminal, I have to define the full path. For instance I installed npm-check-updates, but I can't run ncu or npm-check-updates command from terminal, because it says bash: ncu: command not found. I have to type the full path like this: ~/.npm-global/bin/ncu.
How do I fix this?
Hi there I noticed this hasn't been answered so I'm responding just in case I or anybody else runs into the same problem in future.
Here's what worked for me:
npm install -g npm-check-updates
ncu -u
after running the second command, you should see a list of all your dependencies and their latest versions then run
npm install
to install new versions.

Not able to install #angular/cli using npm

I am new to "#angular/cli", I have tried every thing but could not install.
I am tired now please some one can help me to install angular 4 "#angular/cli" in my system.
node and npm Version
and when I am installing "npm install -g #angular/cli" then getting
after installing node -v 6 I am getting below erorr
please suggest me where actually I am wrong.
My friend,
Please try: npm cache clean --force. Maybe your npm cache got confused.
It could be issue with your node version. I will suggest you to reinstall node and try it again.
Or you can also try to clean node cache of using npm cache clean --force
List of Npm registry
https://registry.npmjs.org/ (Dfault One)
https://r.cnpmjs.org/
https://registry.npm.taobao.org/
https://registry.nodejitsu.com/
https://skimdb.npmjs.com/registry
To switch just type
npm config set registry "https://registry.npmjs.org/"
Replace the registry url with the above urls check which one works for you.
I am from india so i used https://r.cnpmjs.org/ and the same error got resolved.
Note: Please use npm cache clear (To clear cache ) and npm cache verify (To verify its clear or not), This Method works for me
Changing Registry location worked for me .
Using :
npm config set registry "https://registry.npmjs.org/"
few warnings but meh! life's too short for warnings.(Every thing is working fine BTW)
It is possible your npm cache has a corrupted file, perhaps it partially downloaded something and then got an error. Try npm cache clean --force and see if that helps.
If that doesn't help look in the log file given in the error message. Find the unexpected end of JSON input message in the log file and look before it to see if there are any other hints to the problem.
You updated your question with a new error message. That one is more specific about the corrupted file. Try removing the cli-1.5.5.tgz file from the path specified and try again. If you are using a web proxy on your network then it is also possible that your proxy has stored a corrupted cache: if you are able then turn off any proxies configured for your system and try a direct download.
Perhaps you are missing space- npm install -g #angular/cli#latest
1) Install node.js and check and node -v in command prompt. (Node.js
through website).
2) npm install -g #angular/cli#latest (run in command prompt).
Refer this link for further help
https://github.com/angular/angular-cli
3) Check node -version
4) Check npm -version
5) check ng -version
If already installed, then uninstall it and install again,
npm uninstall -g #angular/cli
npm cache clean
Both the CLI and generated project have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.
Try using different Node version.
First try updating NodeJS(8.9.3) and npm(5.6.0). These are the LTS versions. For Node this can be important! If that doesn't work, follow this installation guide for windows.
Make sure you are not connected to VPN while installation is on.
Also, please cleanup your node_modules folder before your next try. I use the command rimraf node_modules to remove this directory in windows.
Lastly try running npm install -g #angular/cli#latest
run npm install -g #angular/cli#latest in command prompt as an admin.
right click the windows button, click on command propmt (Admin) or windows power shell(Admin) depending on your windows version. Then type the command and run it.
Most times, you could get issues when you want to install as a normal user considering the fact that you are using the -g (global) flag.
We too have the same kind of issue with user login then we tried from Administrator login its worked for us. Please do the same it may fix for you too.
Please try running:
rm -rf node_modules package-lock.json
And this,
npm install
If it still does not work, try to manually install cli:
npm install --save-dev #angular/cli
When an npm package is published, the publishing process generates a checksum that npm uses at install time to verify that the package didn't get corrupted in transit.
I had the exact same problem, while i was working in a client site, so the problem could be not your environment, they may have a proxy that needs to be configured, in my case we had a nexus server we were going through, and it has something wrong, but when i started using npm registry directly everything worked fine, but most of the time it's a cache problem, to be sure of that you should run:
npm doctor
you will probably find where is the issue.
if not please post the result maybe i can help.
Make sure your console is running as Admin,
Reinstall node & npm
Reinstall angular/cli
Most probable issue is with npm cache. Just clean your npm cache by command
npm cache clean --force
It should work well.
Uninstall your node package. And try the following
Install the latest node package from
https://nodejs.org/en/download/
Check your node and npm version by
node -v
npm -v
Now install the Angular latest version by
npm install -g #angular/cli
Check the angular version by
ng v
Now start creating your application from
https://angular.io/guide/quickstart
So I'm working with Hyperledger which requires you to have a certain Node version 8 and therefore you cannot use the newest angular installation. Perhaps I can recommend another alternative?
cd into the directory
npm install
npm start
You can also clean your npm cache but if one way doesn't work, try the other.
Try navigating to /usr/local/bin and :
if check if the file named ng is present over there, if yes then
rm -r ng and it will remove that file.
Then you can try sudo npm i -g #angular/cli#latest
And it will be a successful install.
(Writing this for those who might also face this issue in future)
Npm cache clean --force
Then install npm
Then go for angular
Npm I -g #angular/cli
was having a similar issue while installing angular cli using npm.
this was resolved by running:
npm cache clean --force
It happened to me once, looked like I had to specify the version of angular cli:
https://github.com/angular/angular-cli/issues/11589
e.g.:
npm install -g #angular/cli#1.5.0
It could be issue with your node version. I will suggest you to reinstall node and try it again.
Or you can also try to clean node cache of using npm cache clean --force
Please check this also Perhaps you are missing space- npm install -g #angular/cli#latest

NPM appears to do nothing on Linux Mint 15

searched, and did not see this specific problem.
Trying to get a MEAN stack built on my Linux Mint machine, and bumping into a bit of an unusual issue.
Got MongoDB installed, and finally got it running correctly (none of the instructions ANYWHERE mentioned having to create the /data/db/ directory and set permissions, go figure).... it works now.
Got NodeJS installed, and it appears to work correctly.
I had been told (apparently incorrectly) that NPM installs right alongside Node, with:
sudo apt-get install nodejs
but:
$ npm
bash: /usr/bin/npm: No such file or directory
So I go ahead and install NPM separately.
$ sudo apt-get install npm
Seems to work, so far, no errors, and it looks like it is pulling down the NPM package and installing it...
$ nodejs -v
v0.10.21
$ npm -v
$
?? It simply fails to respond without any error... so I try:
$ npm install grunt -g --save-dev
$
Same completely silent failure... in fact, NOTHING I could do gets a response out of NPM.
Looked all over the web, and saw nothing similar anywhere... found out that NPM holds its cache files in ~/.npm and noticed that this folder didn't exist (kinda like the mongo issue above), so I created it, and set permissions to 7777... still nothing.
Purged and re-installed both node and npm, tried installing them both together and separately (yes, desperation)... still no love.
WTF am I doing wrong?
I would love, eventually, to have a nice development environment setup, hopefully with Cloud9 as a local IDE.... but already pulling my hair out.
=========================================================================================
OK, after a few more headaches, this is up and built now... thank you all.
Would love to mark both as answers, but it won't let me.
npm does come with node. Where is apt-get pulling it from? I install the Mac OS X packages on my Mac for development and npm does in fact come with it. I compile from source on my CentOS server and npm comes with it.
Your package provider may be providing them separately as a (in)convenience to you.
As for why your npm command does not work after installation, I can't say for sure, but I am suspicious of your use of --save-dev and -g together.
-g means to install globally, which means 2 things:
It will be installed outside of your npm package's structure into a system location like /usr/bin or /usr/local/bin
It requires root access to install. Did you use sudo to run it with root access?
Both of those requirements conflict with --save-dev which records the package as a dependency in your package.json file so that future npm install commands will install that package within the project space.
That said, I happen to know a lot about grunt. It has 2 parts, a globally installed tool and the package-specific tool. The correct way to install it is:
$ [sudo] npm install -g grunt-cli
$ npm install grunt --save-dev
This will install the grunt-cli package into a system location guaranteed to be in the $PATH, which turns around and looks for a package-specific grunt installed which is not system-wide.
When installing nodejs with npm, this one-liner worked for me.
sudo apt-get install nodejs nodejs-dev npm
I don't believe npm comes with the nodejs installation in the apt repo. Try to install npm separately using the following tutorial http://www.giantflyingsaucer.com/blog/?p=1688 'To install NPM ....'
====== Edit ====
node and npm IS separate. Follow the official wiki and everything should be fine

Resources