Installing nuclide on Atom - node.js

I am trying to install nuclide on Atom but I am getting the follwong error. When I run
apm install nuclide
Installing “nuclide#0.125.0” failed.Hide output…
npm WARN engine nuclide#0.125.0: wanted: {"atom":">=1.5.3","node":">=4.1.1"} (current: {"node":"0.10.40","npm":"2.13.3"})
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/ammathu/Downloads/Atom 2.app/Contents/Resources/app/apm/bin/node" "/Users/ammathu/Downloads/Atom 2.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/ammathu/.atom/.apm/.apmrc" "--userconfig" "/Users/ammathu/.atom/.apmrc" "install" "/private/var/folders/sk/rxnvp2hs2nd0xp3w_bsq3f1d6b3pqf/T/d-116222-56925-dimbjc/package.tgz" "--target=0.34.5" "--arch=x64"
npm ERR! node v0.10.40
npm ERR! npm v2.13.3
npm ERR! version not found: relative-date#1.1.2
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /private/var/folders/sk/rxnvp2hs2nd0xp3w_bsq3f1d6b3pqf/T/apm-install-dir-116222-56925-votedf/npm-debug.log
Any idea how to fix it?
node -v gives me v5.0.0`

I've been able to install it from source:
http://nuclide.io/docs/advanced-topics/building-from-source/#linux__building
Run the following commands to build Nuclide from source.
# Clone the source
$ git clone https://github.com/facebook/nuclide.git
$ cd nuclide
# Install dependencies
$ npm install
# Link the 'nuclide' package to Atom's package directory
$ apm link
Verify the installation by:
Open Atom.
Go to Atom | Preferences.
Click on Packages.
Verify nuclide as one of the packages.

This solved it for me.
$ git clone https://github.com/facebook/nuclide.git
$ cd nuclide
# Install dependencies
$ yarn --pure-lockfile
# Link the 'nuclide' package to Atom's package directory
# You could also use apm link --dev ... see Development Mode below.
$ apm link
The npm install did not install all the modules necessary. Kept giving me errors, could not find module-...
This is given in the their docs.
https://nuclide.io/docs/advanced-topics/building-from-source/#linux__building

Related

After Upgrading my npm from version 6 to version 7 (node version was 10) I cant install dependencies for some projects

I had node version 10 installed in my system, after upgrading my npm from version 6 to version 7 I couldn't install the dependencies, and I'm getting error so I had to downgrade my node to 6,
(both npm ci and npm i was failing)
And the project I was testing is this:
https://github.com/Giveth/feathers-giveth
the errors were something like this:
npm ERR! code 128
npm ERR! git dep preparation failed
npm ERR! command /Users/username/.nvm/versions/node/v10.23.0/bin/node /Users/username/.nvm/versions/node/v10.23.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/username/.npm/_cacache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command git clone --mirror -q ssh://git#github.com/gulpjs/gulp.git /Users/renjer/.npm/_cacache/_cacache/tmp/git-clone-dfb83c15/.git
npm ERR! npm ERR! fatal: destination path '/Users/username/.npm/_cacache/_cacache/tmp/git-clone-dfb83c15/.git' already exists and is not an empty directory.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /Users/username/.npm/_cacache/_logs/2021-02-18T16_18_35_855Z-debug.log
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/username/.npm/_logs/2021-02-18T16_20_15_536Z-debug.log
This problem usually happen because if you only upgrade the node version of the system, there are some packages and dependencies that are installed according to that version.
This is a manual process, but you have to install the package according that version.
For example (package.json):
In your node 6 version you have some package:
"xyz":^1.2.3
that package was installed and its dependencies to work with node 6
delete manually that package from your package.json and install it manually like
npm install xyz
Then is possible that you notice an upgrade to the version, something like:
"xyz":^4.5.6
Do that for everyone of your packages and probably your problem disappears. That's the way that I have used to solve that problem.
You can also upgrade all the packages to its lasts version but ... if you have many packages and someone is not working you are not going to know which one is failing, and you are going to check it individually.
Maybe (at the moment of writing this answer) if you are using Node 10, the latest package's version is not going to work either because that version could be fixed to work with Node 16 (the LTS (Long term support) version at the moment of writing this answer).
If you haven't done that yet, I suggest to continually upgrade your system to the some LTS version that isn't deprecated.

Getting error on angular CLI isntallation

I am trying to install angular/cli on my windows10 64-bit machine, But I am getting the following error:
npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t ssh://git#github.com/angular/cli.git
npm ERR!
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-03-19T08_13_51_165Z-debug.log
I am trying to execute the following command:
npm install -g angular/cli
Following are the specifications:
node --version
v10.15.1
npm --version
6.4.1
Things tried till now as suggested in different posts and forums:
Tried running command prompt as Administrator
Setting the network settings(set https-proxy and proxy).
npm cache clean --force
I don't have git installed on my machine, but is it necessary and mandatory?
I have installed angular previously also(Angular 4) but at that time everything was fine.
Need help.
You should install #angular/cli (note the #)
npm i #angular/cli
This one does not require git to be installed.
I have to admit that this naming is confusing.

Installing github hosted npm dependencies with Docker

I'm trying to dockerize a project, but I'm having issues in the npm install process with my Gulp 4 dependency. I'm using Gulp 4 because we needed some of the new features, but all the instructions I've seen for using the prerelease version of Gulp 4 is to use the github branch url. Here is the offending dependency:
"gulp": "github:gulpjs/gulp#4.0",
And here is the error I get when I try to run docker build -t user/project .:
npm ERR! Error: No compatible version found: gulp#'github:gulpjs/gulp#4.0'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.7","0.0.8","0.0.9","0.1.0","0.2.0","1.0.0","1.1.0","1.2.0","1.2.1","2.0.0","2.0.1","2.1.0","2.2.0","2.3.0","2.4.0","2.4.1","2.6.0","2.6.1","2.7.0","3.0.0","3.1.1","3.1.2","3.1.3","3.1.4","3.2.0","3.2.1","3.2.2","3.2.3","3.2.4","3.2.5","3.3.0","3.3.1","3.3.2","3.3.4","3.4.0","3.5.0","3.5.1","3.5.2","3.5.5","3.5.6","3.6.0","3.6.1","3.6.2","3.7.0","3.8.0","3.8.1","3.8.2","3.8.3","3.8.4","3.8.5","3.8.6","3.8.7","3.8.8","3.8.9","3.8.10","3.8.11","3.9.0","3.9.1"]
npm ERR! at installTargetsError (/usr/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR! at /usr/lib/node_modules/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/lib/node_modules/npm-registry-client/lib/get.js:148:7)
npm ERR! at /usr/lib/node_modules/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Linux 3.19.0-51-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /src
npm ERR! node -v v0.10.42
npm ERR! npm -v 1.3.6
This is the Dockerfile I'm currently using:
# Using CentOS
FROM centos:centos6
# Enable Extra Packages for Enterprise Linux (EPEL) for CentOS
RUN yum install -y epel-release
# Install Node.js and npm
RUN yum install -y nodejs npm
COPY package.json /src/package.json
# Install app dependencies
RUN cd /src; npm install
# Bundle app source
COPY . /src
# Run server
EXPOSE 8080
CMD ["npm", "start"]
Is there a way to get Docker to be ok with the github url? Or is there an alternate way to include the dependency that Docker would be happy with?
The issue was caused by older version of node available on the base image.
The version of node was not compatible with gulp version.
A base image with newer version of node resolved the issue.

Travis - Control Which Node Version is used for NPM Installs

I am attempting to install an npm package (markdown-pdf) as part of my Travis-CI build which I believe is not compatible with old versions of Node. On my local machine, I am running Node version 0.10.36, and it works here, so I added what I believe to be the accepted way of defining a specific version to the top of my .travis.yml file (although I'm not clear on that either). The MCVE version of the full file is below.
language: node_js
node_js:
- "0.10"
install:
- sudo apt-get install npm
- npm config set registry http://registry.npmjs.org/
- sudo npm install -g markdown-pdf
script:
- echo "stuff was installed."
At the top of the build log, I see the following, which seems to indicate that my change worked:
$ nvm install 0.10
######################################################################## 100.0%
Now using node v0.10.40
$ node --version
v0.10.40
$ npm --version
1.4.28
$ nvm --version
0.23.3
However, further down the log, when travis attempts to execute sudo npm install -g markdown-pdf, the log reports the following. Notice that it suggests that the package might not be compatible with the version of Node that is installed, and it claims that I'm using Node v0.6.12.
$ sudo npm install -g markdown-pdf
npm http GET http://registry.npmjs.org/markdown-pdf
npm http 200 http://registry.npmjs.org/markdown-pdf
npm ERR! Error: No compatible version found: markdown-pdf
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR! at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR! at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR! at /usr/share/npm/lib/cache.js:408:5
npm ERR! at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /home/travis/build/ahemmeter/ahemmeter.github.io/npm-debug.log npm
npm ERR!
npm ERR! System Linux 2.6.32-042stab108.3
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "markdown-pdf"
npm ERR! cwd /home/travis/build/ahemmeter/ahemmeter.github.io
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: markdown-pdf
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/travis/build/ahemmeter/ahemmeter.github.io/npm-debug.log
npm not ok
I think I've provided enough information, but you can also look at the public build logs for the project and the github repository it's building.
Have I made a mistake in declaring which version of Node to use? Do I need to (or should I) do something similar for npm, nvm, and markdown-pdf? How can I force npm-install to use the newer version of Node rather than the old one?
Note that I set the repository to download over HTTP instead of HTTPS. When I did that, the error message changed from "failed to fetch from registry: markdown-pdf" to "No compatible version found: markdown-pdf", which seemed like a step in the right direction, so I kept it; however, I mention it here in case there is a possibility that it causes a conflict.
In order to specify dependencies when using node.js, travis seems to expect a package.json file. You can also use this to specify which version of the node package you want to download.
.travis.yml
language: node_js
node_js:
- "0.10"
script:
- echo "stuff was installed."
package.json
{
"name" : "ahemmeter.github.io",
"version" : "0.0.0",
"dependencies" : {
"markdown-pdf" : "5.3.x"
}
}
Note from OP: This is the answer I found, but If someone posts an answer that does not involve using a package.json file (this is just a test suite rather than a package and I don't want to publish it as a package), I'll mark that answer as accepted.

NPM install giving error installing express

When I give command npm install express it throws following error. On ubuntu machine
gaurav#gaurav-Mini-Monster:~/TestScripts$ sudo npm install -g express
npm ERR! error installing express#3.3.3 Error: Unsupported
npm ERR! error installing express#3.3.3 at checkEngine (/usr/local/lib/node_modules/npm/lib/install.js:493:14)
npm ERR! error installing express#3.3.3 at Array.0 (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
npm ERR! error installing express#3.3.3 at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:13)
npm ERR! error installing express#3.3.3 at chain (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:20:4)
npm ERR! error installing express#3.3.3 at installOne_ (/usr/local/lib/node_modules/npm/lib/install.js:470:3)
npm ERR! error installing express#3.3.3 at installOne (/usr/local/lib/node_modules/npm/lib/install.js:411:3)
npm ERR! error installing express#3.3.3 at /usr/local/lib/node_modules/npm/lib/install.js:347:9
npm ERR! error installing express#3.3.3 at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:54:35
npm ERR! error installing express#3.3.3 at Array.forEach (native)
npm ERR! error installing express#3.3.3 at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:54:11
npm ERR! error rolling back express#3.3.3 Error: UNKNOWN, Unknown error '/usr/local/lib/node_modules/express'
npm ERR! Unsupported
npm ERR! Not compatible with your version of node/npm: connect#2.8.3
npm ERR! Required: {"node":">= 0.8.0"}
npm ERR! Actual: {"npm":"1.0.106","node":"0.5.11-pre"}
npm ERR!
npm ERR! System Linux 3.2.0-48-generic-pae
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express"
npm ERR! cwd /home/gaurav/TestScripts
npm ERR! node -v v0.5.11-pre
npm ERR! npm -v 1.0.106
npm ERR! code ENOTSUP
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/gaurav/TestScripts/npm-debug.log
npm not ok
I also tried
sudo npm install express
npm install -g express
sudo npm install -g express
Nothing works.
Node is so easy to install manually. I like doing it this way too because it's really easy to switch versions.
This is also great because you don't need to add some external package repository to apt, and you don't have to wait for those repositories to update when node releases a new version. You can get updates as soon as they're released.
# make a `~/.nodes/ folder
mkdir -p ~/.nodes && cd ~/.nodes
# download the binaries from nodejs.org
# in this case, here's the linux version
curl -O http://nodejs.org/dist/v0.10.12/node-v0.10.12-linux-x64.tar.gz
# extract
tar -xzf node-v0.10.12-linux-x64.tar.gz
# rename folder to 0.10.12
mv node-v0.10.12-linux-x64 0.10.12
# create a `current` symlink
ln -s 0.10.12 current
# prepend ~/.nodes/bin to your path
# you'll want to save this in ~/.bashrc or ~/.zshrc or something
export PATH="~/.nodes/current/bin:$PATH"
# cleanup
rm ~/.nodes/node-v0.10.12-linux-x64.tar.gz
The best part about this is you can repeat the pattern for any other version of node, change the current symlink at any time to switch which version you're running, and you're good to go
% node --version
v0.10.12
% npm --version
1.2.32
# switch versions to (e.g.) 0.10.5
% cd ~/.nodes && rm current && ln -s 0.10.5 current
% node --version
v0.10.5
% npm --version
1.2.18
Additional pointers when writing executable scripts
Make an executable file
% touch ~/somefile && chmod +x ~/someifle && nano ~/somefile
File contents
#!/usr/bin/env node
console.log(process.version);
Run it
% ./somefile
v0.10.12
You are running a much-too-old version of node and npm. You have node v0.5 which is very out of date. Upgrade to node v0.10 and things will work.
Modern node.js versions for Ubuntu are available via this PPA from Chris Lea
To install:
sudo apt-get install python-software-properties
sudo add-apt-repository --yes ppa:chris-lea/node.js
sudo apt-get install nodejs
UPDATE
It looks like your old version of node is installed at /usr/local/bin/node. The new version from the Chris Lea PPA will be at /usr/bin/node. So to verify all is well, do:
/usr/bin/npm --version #Should be approx 1.2
/usr/bin/node --version #should be approx v0.10
/usr/bin/npm install -g express
You should uninstall the local node, or fix your PATH:
export PATH=/usr/bin:$PATH

Resources