How to install a NodeJS package from a github repo - javascript

I'm trying to install a package from a github repo but I get the following message:
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/z0019rb/.nvm/versions/node/v4.4.7/bin/node" "/Users/z0019rb/.nvm/versions/node/v4.4.7/bin/npm" "install"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/target-digital-design-tokens
npm ERR! 404
npm ERR! 404 'target-digital-design-tokens' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'target-base-pattern-library'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/z0019rb/dev/design-systems/designsystems-site/npm-debug.log
And this is what my package.json looks like:
"target-digital-design-tokens": "git+ssh://git#git.target.com:design-systems/design-tokens.git"
Not sure what I'm doing wrong. The repo which I'm trying to install has a package.json. Thanks!

try this instead :
"git+https://target.com/design-systems/design-tokens"
and don't forget to set git repo in your package.json like so :
"repository": {
"type": "git",
"url": "git#target.com:design-systems/design-tokens.git"
},
If the git server is behind a proxy don't forget to set env http_proxy before npm install something like this :
npm config set proxy "http://domain......#myproxy:8080"
npm config set https-proxy "http://domain......#myproxy:8080"

Related

when trying npm install -D live-sever errors occur javascript

I always face troubles when i do npm install in my system. this time I am following javascript tutorial so he shows us to use the command npm install -D live-sever and it occurs errors. by the way im using internet behind proxy.
`npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/live-sever - Not found
npm ERR! 404
npm ERR! 404 'live-sever#*' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
The correct name is live-server:
npm install -D live-server

Can not install npm install #here/maps-api-for-javascript --save

I can not install Maps API for node.js, according to this manual
https://developer.here.com/documentation/maps/3.1.20.0/dev_guide/topics/get-started-bundling.html
PS K:\Gran-canar\NODE-HERE\first-project> npm install #here/maps-api-for-javascript --save
npm ERR! code E404
npm ERR! 404 Not Found - GET http://registry.npmjs.org/#here%2fmaps-api-for-javascript - Not found
npm ERR! 404
npm ERR! 404 '#here/maps-api-for-javascript#latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Alvares\AppData\Roaming\npm-cache_logs\2020-12-04T03_04_24_998Z-debug.log
PS K:\Gran-canar\NODE-HERE\first-project>
For me this worked
npm install #here/maps-api-for-javascript --registry=https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript/
This seems to be an old post so it is probably too late to help the OP but From your error, it looks you missed running this line:
npm config set #here:registry https://repo.platform.here.com/artifactory/api/npm/maps-api-for-javascript/
As npm install #here/anything should not be checking HTTP://registry.npmjs.org/ for the module files as they do not exist there.

npm ERR! 404 Not Found - GET https://registry.npmjs.org/create-myreactnativeapp - Not found

I installed the Expo CLI and Node version 12
When I tried to create a new react native project I get this error
See error image here
Error
PS C:\Users\leosu\Documents\GitProjects> npm init myreactnativeapp
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/create-myreactnativeapp - Not found
npm ERR! 404
npm ERR! 404 'create-myreactnativeapp#latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\leosu\AppData\Roaming\npm-cache_logs\2020-05-12T23_54_32_833Z-debug.log
Install for [ 'create-myreactnativeapp#latest' ] failed with code 1
PS C:\Users\leosu\Documents\GitProjects>
Any ideas on how to solve this?
If you're using Expo it should be:
expo init myreactnativeapp
Instead of npm init myreactnativeapp
Assuming that you already ran npm install -g expo-cli

How to install socket.io and mysql on Node.js

I'm too newbie to Node.js.
I'm trying to setup a basic site (in order to learn), to make a call from Javascript in front end to Node.js and return the data of a mysql query.
I followed some tutorials in internet and I made this packages.json file
{
"name": "Stock",
"version": "0.0.1",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-watch": "^0.6.1",
"grunt-execute": "^0.2.2",
"socket.io":"lastest"
}
}
Then on my Linux I run: npm install Which I understand it will install all dependencies listed on the packages.json. But I'm getting this error:
npm WARN package.json Stock#0.0.1 No description
npm WARN package.json Stock#0.0.1 No repository field.
npm WARN package.json Stock#0.0.1 No README data
npm http GET https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/socket.io
npm ERR! Error: No compatible version found: socket.io#'lastest'
npm ERR! Valid install targets:
npm ERR! ["0.3.8","0.4.0","0.4.1","0.5.1","0.5.3","0.6.0","0.6.1","0.6.3","0.6.4","0.6.5","0.6.6","0.6.7","0.6.8","0.6.9","0.6.10","0.6.11","0.6.12","0.6.14","0.6.15","0.6.16","0.6.17","0.6.18","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.7.5","0.7.6","0.7.7","0.7.8","0.7.9","0.7.10","0.7.11","0.8.0","0.8.1","0.8.2","0.8.3","0.8.4","0.8.5","0.8.6","0.8.7","0.9.0","0.9.1","0.9.1-1","0.9.2","0.9.3","0.9.4","0.9.5","0.9.6","0.9.7","0.9.8","0.9.9","0.9.10","0.9.11","0.9.12","0.9.13","0.9.14","0.9.15","0.9.16","1.0.0-pre","1.0.0-pre2","1.0.0-pre3","1.0.0-pre4","1.0.0-pre5","0.9.17","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.1.0","1.2.0","1.2.1","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.3.6","1.3.7"]
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:719:10)
npm ERR! at /usr/share/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR! at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:107: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-31-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pablo/Documents/clients/stock/node
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pablo/Documents/clients/stock/node/npm-debug.log
npm ERR! not ok code 0
I guess latest version for socket.io, is not ok? how would it work?
Part of the code I get from Here
You have a typo in the socket.io version. "socket.io":"lastest" should be changed to "socket.io":"latest".
it's supposed to be "latest" not "lastest"

TypeError: Request path contains unescaped characters

I try to install node.js modules using:
npm install express
but I get this error:
npm http GET https://registry.npmjs.org/express
npm ERR! TypeError: Request path contains unescaped characters.
npm ERR! at Agent.request (_http_agent.js:264:11)
npm ERR! at TunnelingAgent.exports.request (http.js:52:22)
npm ERR! at TunnelingAgent.createSocket (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:117:25)
npm ERR! at TunnelingAgent.createSecureSocket [as createSocket] (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:184:41)
npm ERR! at TunnelingAgent.addRequest (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:80:8)
npm ERR! at new ClientRequest (_http_client.js:112:16)
npm ERR! at Agent.request (_http_agent.js:279:10)
npm ERR! at Object.exports.request (https.js:130:22)
npm ERR! at Request.start (/usr/local/lib/node_modules/npm/node_modules/request/index.js:594:30)
npm ERR! at Request.end (/usr/local/lib/node_modules/npm/node_modules/request/index.js:1186:28)
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.6.11-7.fc16.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "express"
npm ERR! cwd /usr/local/src/node
npm ERR! node -v v0.11.5-pre
npm ERR! npm -v 1.3.5
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/src/node/npm-debug.log
npm ERR! not ok code 0
May be happening I use a proxy I set it up this way to allow downloads from ips outside my network
export https_proxy='http://172.21.0.12:3128'
I hope you can help me
Set proxy from commandline.
npm config set proxy http://proxydomain:port/
If error occur yet, additional try next.
npm config set registry http://registry.npmjs.org/
These work for me.
(ref http://sushichop.blogspot.jp/2013/01/npm-install.html)
Though late enough, I've bumped into this too after updating nodejs (to 4.1.1) and npm (to something like 1.4.x) on Linux.
I've tried the suggested solution, but changing the registry entry did not help in all cases.
Lastly, having decided to reinstall npm, I found this update source [on npm github][1]
curl -L https://www.npmjs.org/install.sh | sh
which updated my npm to 3.3.8 and all related package installation troubles have been blown away.

Categories

Resources