Should I delete my node modules folder and reinstall everything again?
It appears that following David Walsh's way of updating Node has resolved my problem.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Related
I want to install Vue CLI . and i run this on my Git Bash .
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~
$ npm install -g #vue/cli
but having error like this :
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~
$ npm install -g #vue/cli
npm ERR! Unexpected end of JSON input while parsing near '...ery":"latest","throug'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ECLIPSE\AppData\Roaming\npm-cache\_logs\2019-10-09T02_48_52_427Z-debug.log
i try with solution in stackoverflow in this thread here
. i try with
ECLIPSE#DESKTOP-AIUUOKR MINGW64 ~/Desktop
$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
but i try to install again , its have same error . someone can help me about this ?
I had a very similar problem and simple npm cache clean --force command did not help too.
I solved the problem by deleting C:\Users\User\AppData\Roaming\npm and C:\Users\User\AppData\Roaming\npm-cache directories and running an npm cache clean --force command after this. Then, npm install worked properly.
If the problem continues to appear, reinstall Node.js and NPM. Do not forget to check if all previous files connected with them are deleted before the installation!
This process work for me
1 - Run your Command Invite/Terminal as Administrator
2 - Install the Vue CLI globally with the command :
npm install -g vue-cli
Here is how I install NPM on a Linux Mint 19.
sudo apt install nodejs
sudo apt install npm
The NPM version I get is 3.5.2, which is not the current version. To upgrade, I try the following commands.
sudo npm install latest-version
which has a few warning messages such as "not such file or directory, open '/home/me/package.json'"
and
sudo mpn install npm#latest -g
which runs without any warning or error messages.
The command
npm -v
still yields 3.5.2.
What is missing?
Also, the reason of using sudo in those upgrade commands is to work around some access permission.
try running:
which npm
and
sudo which npm
I suspect by running sudo apt-get ... you installed npm for your root user as opposed to your current user.
Try this command: npm install -g npm#latest or npm install -g npm#next
You can update NPM with: npm install -g npm.
See this Q&A for more variations that might occur/needed.
I haven't used sails in a long while and was about to start a new project but wanted to update my older 0.12.14 version to 1.0.2. I first tried doing
$ npm update -g
and then running
$ sails -v
This returned
0.12.14
Confused, I listed the npm global packages
$ npm list -g --depth=0
and this returned the list of global packages without sails.
I tried
$ npm uninstall sails -g
and when running
$ sails -v
or even
$ sails new test
it appeared to continue working. Checking the version in the package.json of the test project revealed that the old version was still alive and kicking. I'm out of ideas on how to update / uninstall sails.
To update Sails.JS, use npm install sails -g instead of npm update -g
If that isn't working, be sure to update to the latest npm & Node.JS:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
then
sudo npm install sails -g
To manually download and install Node.JS: https://nodejs.org/en/
I always have same problem when installing node-sass
sudo npm install -g node-sass
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/max/Sites/xxxxxxx/node_modules/node-sass/build'
I have update my node and npm version but the same nothing to do, it seems something with permission.... any idea?
It seems like it is due to a problem with installing node-sass which is one of the dependencies.
It is due to the use of sudo while trying to install packages.
Read this https://docs.npmjs.com/getting-started/fixing-npm-permissions to see how to fix your permissions.
It looks like you're running into permission issues. If you are installing npm-packages then it might possible that you are getting an EACCES error when trying to install a package globally. This means you do not have permission to write to the directories npm uses to store global packages and commands.
You can change the directory permissions by running commands: sudo chmod u+x -R 775 ~/.npm and sudo chown $USER -R ~/.npm or you can just run any npm command with sudo, that should get resolve your issue.
If you are installing an npm-package locally, then you should be in your local project directory and can try running sudo npm install <pkg-name> command to install required package. the purpose of using sudo is that it will change your owner permissions so you can make your current user authorized to run npm commands.
I'd recommend you to take a look at https://docs.npmjs.com/getting-started/fixing-npm-permissions
If you run sudo npm install -g node-sass --unsafe-perm should fix your issue.
I´ve discovered a weird issue with npm.
Whenever I run npm install the terminal marker just spins (forever) and all other internet use on my machine is blocked. If I abort with ctrl + C and run it again, it does not hang but I get a npm WARN unmet dependency for every dependency.
I´ve tried to reinstall npm but still get the same error.
I´m running OS X El Capitan.
Any ideas?
This can happen if npm dependencies get foobar'd. Please try to reset the whole npm package cache and reinstall:
$ rm -rf node_modules/
$ npm cache clean
$ sudo npm update -g npm
$ npm install
If it doesn't help, please run
$ npm install --loglevel verbose
and post your output.