I'm on Ubuntu 14.04 trying to install this package: https://www.npmjs.com/package/stanford-corenlp
However, whenever I try to do so, it tries to install node-java 0.5.5 as a dependency which fails (gives me node-gyp errors).
I looked this issue up, and it's fixed by using a newer version of node-java. 0.6.1 seems to work fine, but I don't know how to update the dependency to install the stanford-corenlp package.
add
"node-java": "^0.6.1"
in 'dependencies' of your package.json file. Then run npm install. This will install the right version of node-java.
Then try to install standford-corenlp. If they didn't hardcode the node-java version in their package.json, you should be alright
Related
I've tried updating npm after I did some WARNings, so I went
npm audit fix
received way more WARNs. Now when i tried installing all dependencies with
npm i
I got tons of WARN (see below). I honestly haven't got a clue what any of these mean, but did not have any before the npm fix.
Looks like you're using deprecated packages.
Try running
npm outdated
it will show you the current version, desired version, and latest version for each of your package. That won't actually do anything to your project, but it's a good first indication.
If you run
npm update
it will update each package according to what your package.json says.
For instance if you see this in your package.json
"my-package": "~1.25.0"
it means that npm update will update to (or that npm install will install) version 1.25.0 or the latest patch version such as 1.25.4.
If you see
"my-package": "^1.25.0"
it means that npm update will update to (or that npm install will install) version 1.25.0 or the latest minor or patch version such as 1.26.2.
However, npm update will not update your packages to new major versions. That means that "my-package" will not be update to 2.0.0 for instance.
I think using old version of packages can cause those kinds of warnings.
In that case, just reinstall the package to the latest version
npm uninstall my-package
npm i my-package
⚠️ But be careful as updating a package to a new major version could break your code!
My advice is to do it step by step and make sure you can always roll back in case there's a problem you don't understand!
I am looking for a way to upgrade my npm, I follow the option 3 for windows in here npm docs. but when I install it it said npm.exe already in nodejs folder. I try to overwrite it with --force but it still not overwritten. How to do it correctly? also how to update node?
This is the new best way to upgrade npm on Windows.
Run PowerShell as Administrator
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
npm install -g npm-windows-upgrade
npm-windows-upgrade
Note: Do not run npm i -g npm. Instead, use npm-windows-upgrade to update npm going forward. Also if you run the NodeJS installer, it will replace the node version.
Upgrades npm in-place, where node installed it.
Easy updating, update to the latest by running npm-windows-upgrade -p -v latest.
Does not modify the default path.
Does not change the default global package location.
Allows easy upgrades and downgrades.
Officially recommended by the NPM team.
A list of versions matched between NPM and NODE (https://nodejs.org/en/download/releases/) - but you will need to download NODE INSTALLER and run that to update node (https://nodejs.org/en/)
There is a tool, nvm, that solves your problem quite easly. There is also a Windows version, is not as cool as the linux/mac version but it works fine anyway
I suggest using option 1. Go to environment system variables and add "%appdata%\npm" to path like this: edit path
Then updated npm files should be loaded before those you installed with node
Node.js v16 or higher?
npm install -g npm
Node.js v14 or below?
Consider updating to latest LTS release of Node.js
npm-windows-upgrade
I have an abandoned project which is the admin tool for a current project. This project's Material-UI version was 0.19.4. When I delete the dependency from package.json and run npm install, it installs the version "material-ui": "^0.20.2", Also when i edit my package.json, Material-UI's version by hand to version "^1.0.0" the npm crashes: No matching version found for material-ui#1.0.0. What am I missing? Why is the latest version not installed or at least the desired version? Can anyone guide me how to approach the issue?
Side note: When I run the project with the outdated Material-UI, it is not showing as the outdated version.
The newer components are now in #material-ui/core
see: https://material-ui.com/guides/migration-v0x/
npm install #material-ui/core
OR
yarn add #material-ui/core
There are some factors that may be causing the installation to fail. One that I know is maybe the version of npm is not the latest.
Try:
$ npm -g install npm
After that, try installing material-ui again.
That would work.
I can not run the Angular 2 project.
What I tried:
- running the project by using npm install and npm start | does not work
- I cloned quickstart from the github and replaced with my src folder and I still get the "can not find module in #angular/core"
Here is the full console output: https://www.dropbox.com/s/5plmqrjd6ge0lta/error.txt?dl=0
Many people will come here. I have had the same problem. Do not panic. You are probaly following the tutorial of tutorialspoint.
Just install the core again using NPM
npm install #angular/core
There was/is a bug in certain versions of npm that causes installed modules to disappear when using npm install someModule ... or npm install someModule --save-dev
This was apparently an issue if the module being installed was from a GitHub repo and lacked a specific commit hash to reference for the installation. Although the issue was marked "closed" and the repo archived several months ago at v5.6.0, I ran into the problem today w/the latest npm 6.4.0
In my case, doing npm install rxjs completely removed the #angular/core module, along with my #ionic-native plugins, and anything else I'd installed individually (and then it failed to actually/properly install rxjs anyway!!)
Tip: copy your existing npm modules folder as a backup before starting updates or removing it entirely & trying to npm install.
You can manually install to your project via npm install #angular/core, but depending on the npm version (or the angle of the moon at that precise moment, who knows) be aware that you might wind up with other missing dependencies.
Also try npm install #angular/core && npm install ... Apparently the additional npm install helps replace the randomly deleted/missing modules in some cases.
My package.json says I have react-router: 0.13.4 installed. However, when I type in the command npm view react-router it stats that it is using version: '1.0.0-rc3
I even tried npm install react-router#0.13.4 but npm view react-router still produces version 1.0.0-rc3
I believe npm view shows details of the latest remote package release, not the installed version. Look at node_modules/react-router/package.json to see your installed version. Use the npm install react-router#0.13.4 --save command if you want to update your package.json file.
npm install react-router-dom#5.3.0
then check the version in terminal with npm view react-router-dom#5.3.0 version
it will show the version of react router.
If you look at the react-router versioning on their GitHub releases page, you will notice there is no version 0.13.4 after version 0.13.3, which might be why NPM defaults to installing the latest version 1.0.0-rc3.