I'm trying to install packages using NPM. For example I'm trying to get install mongodb on ubuntu 14.04 by the usual
Sudo npm install mongodb
I get this error
npm ERR! tar.unpack untar error /home/cougs/.npm/mongodb/2.0.45/package.tgz
npm ERR! Linux 3.13.0-61-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "mongodb"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! path /mnt/nfs_data/byucougars.com/RebelFleet/app/node_modules/mongodb/package.json
npm ERR! code EINVAL
npm ERR! errno -22
npm ERR! syscall chown
npm ERR! EINVAL: invalid argument, chown '/mnt/nfs_data/byucougars.com/RebelFleet/app/node_modules/mongodb/package.json'
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! /mnt/nfs_data/byucougars.com/RebelFleet/app/npm-debug.log
I'm pretty sure it's a permission issue with my user. probably when I copied stuff to the server via FTP, it screwed things up stuff. I just have no idea how to fix this.
One way to fix this would be to override chown() by LD_PRELOAD to interpose a function which always returns zero ("success"). So instead of
#npm install
you would do
#echo "int chown() { return 0; }" > preload.c && gcc -shared -o preload.so preload.c
#LD_PRELOAD=$PWD/preload.so npm install
I figured out that my code was running on a MNT nfs server using version 4.0. Which changes all permissions to nobody and it was causing the issue to repeat every time I try to fix it. So I just migrated the code back to the original server and it worked fine after that.
Related
when I tried to run vscode-install, it would fail to sync vscode.d.ts. The problem seems random, most of our machines could not success, but two of our machines could success.
The error information is as follows:
Detected VS Code engine version: ^1.23.0
Error installing vscode.d.ts: Error: read ECONNRESET
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lispvsext#0.0.1 postinstall: `vscode-install && node ./node_modules/vscode/bin/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lispvsext#0.0.1 postinstall 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\*\AppData\Roaming\npm-cache\_logs\2019-02-15T09_28_45_624Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lispvsext#1.0.8 postinstall: `cd extension && npm install && cd ..`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lispvsext#1.0.8 postinstall 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\*\AppData\Roaming\npm-cache\_logs\2019-02-15T09_28_45_805Z-debug.log
I had a similar problem, where the VSCode engine in package.json was very old (1.32.0) compared to the current VSCode version (1.64.2). I just updated the engine to the same as my VSCode version in package.json:
"engines": {
"vscode": "^1.64.2"
},
and the tests runner proceeds instead of erroring as before.
Unfortunately, I then got another error:
Error: Running extension tests from the command line is currently only supported if no other instance of Code is running.
which is a different problem and a limitation of VSCode at the moment (1.64.2), though there is a workaround for that.
I'm creating an app with Electron (the GitHub instrument to create apps with html and node.js).
This app will be used by some computer that they aren't connected to internet.
I need to show a map and collocate markers on it (I found Leaflet), but all maps service require internet.
With Open Street Maps I can export an osm file but I can't find a way to render it into Leaflet, because the only library for node (mapbox-gl-native-master) who do it require C++11 and it gives me error in installation:
$ npm install mapbox-gl-native
> mapbox-gl-native#3.2.1 preinstall /home/dpd-/node_modules/.staging/mapbox-gl-native-eb973ff7
> npm install node-pre-gyp
npm ERR! Linux 4.4.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-pre-gyp"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! Cannot read property 'target' of null
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! /home/dpd-/node_modules/.staging/mapbox-gl-native-eb973ff7/npm-debug.log
npm WARN enoent ENOENT: no such file or directory, open '/home /dpd-/package.json'
npm WARN dpd- No description
npm WARN dpd- No repository field.
npm WARN dpd- No README data
npm WARN dpd- No license field.
npm ERR! Linux 4.4.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "mapbox-gl-native"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! mapbox-gl-native#3.2.1 preinstall: `npm install node-pre-gyp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mapbox-gl-native#3.2.1 preinstall script 'npm install node-pre-gyp'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the mapbox-gl-native package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm install node-pre-gyp
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs mapbox-gl-native
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls mapbox-gl-native
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/dpd-/npm-debug.log
Take a look at either Kothic or Mapnik, Both should be more than capable of handling offline osm files. I guess Kothic will be a tad easier to implement (pure JS), since Mapnik essentially is a C++ library with a node.js interface. Additionally, Kothic claims easy integration with Leaflet, so I imagine this should suit you quite well.
Hi am getting the following error while trying to precompile my JSX code. I have been using it but something happened and I am unable to install this
npm install babel-preset-es2015 babel-preset-react
It is showing this error message:
npm ERR! Linux 3.13.0-85-generic npm ERR! argv "/usr/bin/nodejs"
"/usr/bin/npm" "install" "babel-preset-es2015" "babel-preset-react"
npm ERR! node v4.4.5 npm ERR! npm v2.15.5 npm ERR! file
/home/name/.npm/babel-plugin-check-es2015-constants/6.8.0/package/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json npm ERR! Unexpected token '\u0000' at
1:1374 npm ERR!
e#readme","_id":"is-finite#1.0.1","_from":"is-finite#>=1.0.0 <2.0.0"}
npm ERR!
^ npm ERR! File:
/home/name/.npm/babel-plugin-check-es2015-constants/6.8.0/package/package.json
npm ERR! Failed to parse package.json data. npm ERR! package.json must
be actual JSON, not just JavaScript. npm ERR! npm ERR! This is not a
bug in npm. npm ERR! Tell the package author to fix their package.json
file. JSON.parse
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/js/npm-debug.log
How to fix this?
If you want to install globally on your computer those modules, add -g:
npm install -g babel-preset-es2015 babel-preset-react
Otherwise, it meand you want to install it locally. Make sure your have package.json in the root used to launch that command. Follow package rules. Here is an example. Your can try to validate your package.json on package-json-validator.com
MacBooks-MacBook-Pro:~ Apple$ sudo npm install -g ionic
Password:
npm ERR! network tunneling socket could not be established, cause=getaddrinfo ENOTFOUND
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! System Darwin 13.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "ionic"
npm ERR! cwd /Users/Apple
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! code ECONNRESET
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Apple/npm-debug.log
npm ERR! not ok code 0
Try installing without sudo
npm install -g ionic
If that does not help there is an existing Github issue about proxies:
https://github.com/npm/npm/issues/3354
You might also try this Stack Overflow question:
Is there a way to make npm install (the command) to work behind proxy?
I'm running an example from build-nodejs-npm-installation-package-scratch. Instead of uploading to npm repository I'm putting it on Github and trying to download it via npm instead. I run npm install git+https://github.com/t2wu/replaceme.git and got the following:
npm ERR! Error: ENOENT, chmod '/private/tmp/node_modules/replaceme_tim/replaceme.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "git+https://github.com/t2wu/replaceme.git"
npm ERR! cwd /private/tmp
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /private/tmp/node_modules/replaceme_tim/replaceme.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/tmp/npm-debug.log
npm ERR! not ok code 0
I have a package.json in there, I cannot figure out what is wrong.
EDIT: I can install Express OK, but I can't install my practice module
This happens due to missing permissions or unlinked files while npm was working. This topicc is also seen at github, here.
Try running with admin perms.