NPM installation issue ubuntu - angularjs

I want to install npm for use angular2 with laravel5.2 , but while installation of npm. I got below issue :
npm WARN npm npm does not support Node.js v0.10.25
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
/usr/local/lib/node_modules/npm/lib/install.js:298
[this, (next) => { computeMetadata(this.idealTree); next() }],
^
npm ERR! Unexpected token >
npm ERR! A complete log of this run can be found in:
npm ERR! /home/swapnily/.npm/_logs/2017-07-06T07_21_24_104Z-debug.log
Please let me know if anyone aware about same.

Try to run:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Double check there is no error during install.
Then restart you ssh session (just in case) by typing exit then re-connect.
Then check your install with node -v.
If it still does not work, you should check which node is used with which node. The problem may be here (an old version of node is installed somewhere else and in use).

npm does not support Node.js v0.10.25
You're using v0.10.25 which was long deprecated hence this error.
You need node v4 or higher to run this program.
To install an old and unsupported version of npm that works on node v0.12 and prior, clone the git repo and dig through the old tags and branches.
Source npm's doc
I have install " curl -sL deb.nodesource.com/setup_6.x
It isn't clear whether this succeed or not. Assuming that this succeed without errors. Check which version of node is currently being used.
sridharrajs#debian:~$ which node
/home/sridharrajs/.nvm/versions/node/v5.11.1/bin/node -- In mycase I'm using version 5.11.1
Switch to v6.x.x which you've just installed and retry installing.
If you still had issues in installing and switching node versions I recommend you to check
nvm. Using this you can install and switch versions easily.

Related

I can't create a react app and I keep getting the same errors

I run the command, but I get the errors with stuff I don't understand. node -v is v16.14.0
It's problem in, you're npm version consider using a stable version of npm npm version
run this command npm install -g npm#latest it will install the new version of npm
if it's still not working use flag while creating react app npx create-react-app newapp -force and npm cache clear --force
In case it still not working delete package-lock.json from you're project and run npm install again
Try to avoid Node latest version 17.0. Use 14 or 16 version instaed.

npm install --global expo-cli will not install on my Mac

I'm having some trouble installing the exp cli on my computer. I currently have node -v 16.13.1. I ran npm install --global expo-cli and got a lot of error codes that seem to relate to permission issues. So then I ran sudo npm install expo-cli -g --unsafe-perm, and still had no luck. Any idea?
npm WARN deprecated graphql-tools#3.0.0: This package has been
deprecated and now it only exports makeExecutableSchema.\nAnd it will
no longer receive updates.\nWe recommend you to migrate to scoped
packages such as #graphql-tools/schema, #graphql-tools/utils and
etc.\nCheck out https://www.graphql-tools.com to learn what package
you should use instead

sysmlink error when installing tensorflow/tfjs-node

I'm trying to install #tensorflow/tfjs-node#3.2.1 (latest).
I have follow a lot of other questions I saw regarding such problems but haven't found an answer for this specific issue.
I have installed visual studio with the requested build tools.
node 14.15.5
Tried with and without the flag.
This is the output of the install command:
$ npm install #tensorflow/tfjs-node --build-from-source
npm WARN deprecated node-pre-gyp#0.14.0: Please upgrade to #mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the #mapbox scoped package will recieve updates in the future
> #tensorflow/tfjs-node#3.2.0 install C:\Users\dark_\Desktop\projects\tfjs2\node_modules\#tensorflow\tfjs-node
> node scripts/install.js
CPU-windows-3.2.0.zip
* Downloading libtensorflow
* Building TensorFlow Node.js bindings
symlink ./lib/napi-v7 failed: null
npm WARN tfjs2#1.0.0 No description
npm WARN tfjs2#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! #tensorflow/tfjs-node#3.2.0 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the #tensorflow/tfjs-node#3.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dark_\AppData\Roaming\npm-cache\_logs\2021-02-27T18_14_41_492Z-debug.log
After spening a day trying the usual suspects (node-gyp reinstall as global, windows building tools (re)install as global, parameter settings, etc) I've debugged the install script and found an error in it: after the symlink stuff, the author didn't check the "error" variable, and went straight to process.exit(1)
After I tore out my hair, I've found that the solution is on it's way:
https://github.com/tensorflow/tfjs/commit/2e745c8b6efe5ffc396a86cfc50347e629091248
It has been commited to the main branch (2021.02.26), so probably we'll see it in v3.3.0, or v3.2.x
Now the problem is, that if you just do a simple npm install #tensorflow\tfjs-node, the installer sees it as an error, and deletes the whole downloaded directory in node_modules. You COULD prevent the whole thing by:
EXECUTING npm install #tensorflow/tfjs-node --ignore-scripts
THEN correcting the error by hand in the install script (check the commit at the above link) and
RUNNING npm rebuild #tensorflow/tfjs-node --build-from-source.
I needed to restart VSCode, because it had difficulties picking up the references. But if you don't want to mess arround, go back to the v2.x branch for the time being.

Failed at the node-sass#4.11.0 postinstall script. Cannot manage to run this

I have gone through all the questions regarding this issue but I cannot seem to find anything that works.
I am getting this error :-
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.11.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I have tried to remove the node_modules and npm install again. I also tried to remove the node-sass folder in the node_modules and npm install -g node-sass#latest did not work too. I also tried
npm install -g node --unsafe-perm=true --allow-root
and
npm uninstall node-sass
npm cache clean --force
npm install -g node-sass#latest
but nothing seems to be working at all. Is there someone who can shed some light on this please?
Thanks for your time
Unless you're working on some sort of shared project that has strict requirements you can do the following to overcome the issue:
1.) Delete your package.lock file - which indicates the versions to be locked at.
2.) Delete your node_modules folder which contains all the original installations and C++ binary compilations.
3.) Then npm install it all back and npm rebuild for good measure.
It looks like this is documented on the Node-Sass page in NPM. Upgrade to Node-Sass v 4.12.0 and it will work with Node 12.
try this command it should work successfully
sudo npm install -g --unsafe-perm node-sass
it work for me
Following steps worked for me.
Remove node_modules folder.
Remove package-lock.json file.
Run sudo npm install -g --unsafe-perm node-sass
Run npm install without sudo command.
After battling with this issue for a considerable amount of hours, I downgraded from the Current version of Node (12.8.0) to the LTS (10.16.2) and it finally worked. So if you are having issues like mine, maybe try to downgrade the node version and it can help you
This is because of your incompatible node version with the node-sass module
by the way node-sass is deprecated.
check this link and select the best version with your node installed
https://www.npmjs.com/package/node-sass
just use following command.
npm update

How install Start Angular template correctly?

I'm new in the Angular development, so I found this template and I would like to use it. So I'm doing this:
sudo apt-get install -y nodejs
sudo apt-get install -y npm
sudo npm install -g bower
sudo npm install -g grunt-cli
Clone the repository of the project:
git clone https://github.com/start-angular/sb-admin-angular.git
cd sb-admin-agular
npm install bower
But when I try to execute the command npm start, it gives me the follow error:
vagrant#TheMachine:~/sb-admin-angular$ npm start
> sb-admin#0.0.0 start /home/vagrant/sb-admin-angular
> grunt serve
/usr/bin/env: node: No such file or directory
npm ERR! weird error 127
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
vagrant#TheMachine:~/sb-admin-angular$
Any idea how to solve that ? Or what is causing it ?
You might be missing some dependencies. Looks like you only installed bower. Try installing all dependencies using
npm install
Re-follow the installation instructions on the Github page from 5-7:
npm install - bower install is ran from the postinstall
npm start - a shortcut for grunt serve
npm run dist - a shortcut for grunt serve:dist to minify the files for deployment
Some installation routines requires to find the binary "node".
But on Debian based systems the binary is named "nodejs".
To get around this problem I created a syslink.
But be aware that this may introduce other problems later.

Resources