npm install not reading package.json - node.js

not sure what's going on but I have a box running on ubuntu through digital ocean and just cloned my git repo. I have a package.json that is correctly formatted (I've used it before) with ~20 dependencies.
the current dir where I cloned has chmod777 and when I
sudo npm install
It starts installing packages but node_modules doesn't get created nor do any of my node dependencies get pulled in from my package.json and there's a killed log at end of install attempt
Is there anywhere I can begin to debug this? I'm running the latest npm version (3.8.8) and node 5.8
edit: here's the output of npm install
npm WARN deprecated graceful-fs#3.0.8: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs#2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated lodash#0.10.0: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^4.0.0.
npm WARN deprecated wrench#1.4.4: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
npm WARN deprecated npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated graceful-fs#1.1.14: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated lodash#1.0.2: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^4.0.0.
npm WARN deprecated jade#1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
extract:winston → gunzTar ▄ ╢█████████████████████████████████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
Killed
and here's my package.json
{
"name": "app",
"version": "1.0.0",
"main": "server.js",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "~1.10.2",
"bower": "~1.4.1",
"cheerio": "~0.20.0",
"connect-mongo": "latest",
"cookie-parser": "latest",
"express": "latest",
"express-session": "latest",
"growl": "~1.8.1",
"grunt": "~0.4.5",
"grunt-bower-task": "~0.4.0",
"grunt-contrib-concat": "~1.0.0",
"grunt-contrib-copy": "~0.8.0",
"grunt-contrib-jshint": "~1.0.0",
"grunt-contrib-sass": "~1.0.0",
"grunt-contrib-uglify": "~1.0.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-html2js": "~0.3.2",
"grunt-notify": "~0.4.1",
"grunt-script-link-tags": "^1.0.2",
"log4js": "~0.6.33",
"method-override": "~2.0.2",
"moment": "^2.12.0",
"mongoose": "~4.4.7",
"npm": "^3.8.6",
"passport": "latest",
"passport-openid": "latest",
"request": "latest",
"socket.io": "~1.4.5",
"socket.io-client": "^1.4.5",
"time-grunt": "~1.2.1",
"winston": "^2.2.0"
}
}

I think it's the memory running out. you can look at /var/log/syslog to find out if it was node. found here: what can cause nodejs to print killed and exit.
or try adding a swap file.

Related

Not able to install react-dom for react version v0.13.x

I am getting following error when I am trying to run the command npm install react react-dom
npm install react react-dom
- base62#1.2.0 node_modules/base62
- esprima-fb#15001.1.0-dev-harmony-fb node_modules/jstransform/node_modules/esprima-fb
- object-assign#2.1.1 node_modules/jstransform/node_modules/object-assign
- source-map#0.4.4 node_modules/jstransform/node_modules/source-map
- jstransform#11.0.3 node_modules/jstransform
- envify#3.4.1 node_modules/envify
/prd/dir/UI
├─┬ UNMET PEER DEPENDENCY react#16.2.0
│ └── fbjs#0.8.16
└─┬ UNMET PEER DEPENDENCY react-dom#16.2.0
└── fbjs#0.8.16
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.1.3
npm WARN enoent ENOENT: no such file or directory, open '/prd/dir/UI/package.json'
npm WARN react-simple-dropdown#3.2.0 requires a peer of react#0.14.x || 15.x but none was installed.
npm WARN react-simple-dropdown#3.2.0 requires a peer of react-dom#0.14.x || 15.x but none was installed.
npm WARN reflux#0.2.13 requires a peer of react#>=0.12.2 <0.15.0 but none was installed.
npm WARN UI No description
npm WARN UI No repository field.
npm WARN UI No README data
npm WARN UI No license field.
npm ERR! code 1
Follow are my dev dependencies:
"devDependencies": {
"babel-core": "^5.8.25",
"babelify": "^6.1.x",
"browser-sync": "^2.7.13",
"browserify": "^10.2.6",
"debowerify": "^1.3.1",
"del": "^1.2.0",
"eslint-plugin-react": "^3.6.3",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-if": "^1.2.5",
"gulp-imagemin": "^2.3.0",
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.x",
"gulp-sourcemaps": "^1.5.2",
"gulp-streamify": "0.0.5",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.6",
"history": "^1.12.5",
"humps": "^0.6.0",
"lodash": "^3.10.0",
"react": "^0.13.x",
"react-document-title": "^1.0.2",
"react-router": "^1.0.0-rc1",
"reflux": "^0.2.9",
"run-sequence": "^1.1.1",
"superagent": "^1.2.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.2.x"
}
In order to install a specific version of the npm package, you can mention the version at the end like
npm install -S react#0.13.x
However, I would highly recommend you to go with the latest versions. Also React-DOM was created as a separate package only from version 0.14.0 and hence is not needed before that. Check this answer react vs react DOM confusion

Angular 2 Quick start tutorial issue

Hello everybody so i've ran into some issues as I am learning Angular. I initially watched thenewboston's Angular 2 tutorial. When i finished that I then proceeded to follow Angular's quick start tutorial.The two are very similar, but in bucky's its set up to make js files out of ts files. I updated the package.json by according to the errors, but when I run npm install it gives me errors that a certain package is need. More importantly i feel as if this is somehow affecting the behavior cause I cant nest the component as in Angular's hero list tutorial. package.json:
{
"name": "angular-2",
"version": "1.0.0",
"scripts": {
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.21",
"systemjs": "0.19.41",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.9",
"rxjs": "5.0.0-rc.4",
"rxjs": "5.0.1",
"rxjs": "5.0.0-beta.6",
"zone.js": "0.6.12"
},
"devDependencies": {
"concurrently": "^3.1.0",
"lite-server": "^2.1.0",
"rxjs": "5.0.0-rc.4",
"typescript": "^2.1.4",
"typings": "^2.1.0"
}
}
npm WARN #angular/core#2.3.1 requires a peer of
rxjs#5.0.0-rc.4 but none was installed. npm WARN #angular/core#2.3.1
requires a peer of zone.js#^0.7.2 but none was installed. npm WARN
#angular/http#2.3.1 requires a peer of rxjs#5.0.0-rc.4 but none was
installed. npm WARN #angular/router#3.3.1 requires a peer of
rxjs#5.0.0-rc.4 but none was installed. npm WARN
angular-in-memory-web-api#0.2.2 requires a peer of rxjs#5.0.1 but none
was installed. npm WARN angular-in-memory-web-api#0.2.2 requires a
peer of zone.js#^0.7.4 but none was installed. npm WARN
angular2#2.0.0-beta.21 requires a peer of reflect-metadata#0.1.2 but
none was installed. npm WARN angular-2#1.0.0 No repository field.
Remove the extra rxjs entries in the dependencies. npm works by reading the dependencies list and semantic version numbers to determine what actual version of a particular dependency to install. Believe removing rxjs will alleviate the immediate issue of the npm warnings. Regarding the nested components it should probably be it's own question but either way would need to see the actual source.

Update Angular2 to latest version

I am trying to update Angular2 to the latest version release candidate 4.
I have executed npm outdated and edited accordingly the package.json file.
Then I have executed npm update which failed. I haven't saved the error message. In the following I googled and tried several different npm commands. Unfortunately I cannot recall them.
The current status is, that npm update does not show anything; so seems to work.
The command npm start starts the server, but the browser console displays multiple errors. The first is:
http://localhost:3000/node_modules/#angular/platform-browser-dynamic/platform-browser-dynamic.umd.js Failed to load resource: the server responded with a status of 404 (Not Found)
Besides npm install shows the following warnings:
typings WARN deprecated 2016-06-02: "registry:dt/core-js#0.0.0+20160317120654" is deprecated (updated, replaced or removed)
typings WARN deprecated 2016-06-22: "registry:dt/node#4.0.0+20160509154515" is deprecated (updated, replaced or removed)
typings WARN deprecated 2016-06-22: "registry:dt/jasmine#2.2.0+20160505161446" is deprecated (updated, replaced or removed)
├── core-js (global)
├── jasmine (global)
└── node (global)
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm WARN optional Skipping failed optional dependency /lite-server/browser-sync/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.12
npm WARN #angular/core#2.0.0-rc.4 requires a peer of rxjs#5.0.0-beta.6 but none was installed.
npm WARN #angular/http#2.0.0-rc.4 requires a peer of rxjs#5.0.0-beta.6 but none was installed.
npm WARN #angular/router#3.0.0-beta.2 requires a peer of rxjs#5.0.0-beta.6 but none was installed.
npm WARN #angular/router-deprecated#2.0.0-rc.1 requires a peer of #angular/core#2.0.0-rc.1 but none was installed.
npm WARN #angular/router-deprecated#2.0.0-rc.1 requires a peer of #angular/common#2.0.0-rc.1 but none was installed.
npm WARN #angular/router-deprecated#2.0.0-rc.1 requires a peer of #angular/platform-browser#2.0.0-rc.1 but none was installed.
npm WARN angular2-in-memory-web-api#0.0.14 requires a peer of rxjs#5.0.0-beta.6 but none was installed.
The package.json relevant parts are currently:
"dependencies": {
"#angular/common": "2.0.0-rc.4",
"#angular/compiler": "2.0.0-rc.4",
"#angular/core": "2.0.0-rc.4",
"#angular/http": "2.0.0-rc.4",
"#angular/platform-browser": "2.0.0-rc.4",
"#angular/platform-browser-dynamic": "2.0.0-rc.4",
"#angular/router": "3.0.0-beta.2",
"#angular/upgrade": "2.0.0-rc.4",
"angular2-in-memory-web-api": "0.0.14",
"angular2-uuid": "^1.0.7",
"bootstrap": "^3.3.6",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.9",
"systemjs": "0.19.31",
"zone.js": "^0.6.12"
},
"devDependencies": {
"concurrently": "^2.0.0",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^1.0.4",
"canonical-path": "0.0.2",
"http-server": "^0.9.0",
"tslint": "^3.7.4",
"lodash": "^4.11.1",
"jasmine-core": "~2.4.1",
"karma": "^1.1.0",
"karma-chrome-launcher": "^1.0.1",
"karma-cli": "^1.0.1",
"karma-htmlfile-reporter": "^0.3.4",
"karma-jasmine": "^1.0.2",
"protractor": "^3.3.0",
"rimraf": "^2.5.2"
},
Follow these steps:
Delete node_modules folder.
Take latest package.json from https://angular.io/guide/quickstart
Run 'npm install' command.
In typings.json one must update to new registry value, if problem shows up for core-js
"core-js": "registry:dt/core-js#0.0.0+20160317120654"
to
"core-js": "registry:dt/core-js#0.0.0+20160725163759"
https://github.com/mgechev/angular2-seed/commit/8a8c64e0e8b18cd0c19c1ab2f1dc71a30bbd6174
This might be outdated but your typings were never addressed. Given that you would want to always keep them up to date. Also for anyone else seeking to know about the update process
Here is how you could update/reinstall them
Example:
For your node to update it simply type
typings install dt~node --save --global
The following will update your node typings which would be in /typings/global/node
If you did not have node the same command would suffice and your index.d.ts will also be update with a new entry!

npm WARN deprecated xxx: what should I do?

I've been using grunt from a couple years now, and it's been like forever i've been seeing warnings like the following:
npm WARN deprecated win-spawn#2.0.0: use [cross-spawn](https://github.com/IndigoUnited/node-cross-spawn) or [cross-spawn-async](https://github.com/IndigoUnited/node-cross-spawn-async) instead.
npm WARN deprecated lodash#0.9.2: lodash#<2.0.0 is no longer maintained. Upgrade to lodash#^3.0.0
npm WARN deprecated lodash#1.0.2: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^4.0.0.
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated lodash#2.2.1: lodash#<3.0.0 is no longer maintained. Upgrade to lodash#^4.0.0.
my projects actually work anyway, even with these warnings. lodashis generally the one always giving me warnings, since day one.
here's the package.json file producing these errors:
{
"name": "xxx",
"version": "0.1.1",
"devDependencies": {
"autoprefixer": "^6.2.3",
"cssnano": "^3.4.0",
"grunt": "^0.4.5",
"grunt-browser-sync": "^1.5.3",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-htmlmin": "^0.6.0",
"grunt-contrib-imagemin": "^1.0.0",
"grunt-contrib-sass": "~0.7.4",
"grunt-contrib-uglify": "~0.5.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-critical": "^0.2.0",
"grunt-delete-sync": "0.0.2",
"grunt-newer": "^0.7.0",
"grunt-postcss": "^0.7.1",
"grunt-processhtml": "^0.3.13"
}
}
I guess some module or dependency is outdated but...
1) why is it still working? is it safe to ignore the warnings?
2) how do I know which module is outdated and what should i do about it?
Deprecated means it's not further developed, but also it won't change ever again. If a module relies on a deprecated package which has a bug the only way to solve is to upgrade the dependency. But as nothing changes it will work as it was working all the time.

NPM in Windows not installing module or adding to package.json

I have no idea why I get an error for mongoskin. I used this module before but I got rid of it. I removed the node_modules directory then did a fresh npm install, fine everything installs. Then I tried to add a new module minimist as seen below:
C:\www\instantynode\src>npm install minimist --save
npm WARN package.json instanty#0.1.1 No description
npm WARN package.json instanty#0.1.1 No repository field.
npm WARN package.json instanty#0.1.1 No README data
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "minimist" "--save"
npm ERR! node v4.4.0
npm ERR! npm v2.14.20
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package mongodb#2.1.4 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer mongoskin#1.4.13 wants mongodb#~1.4
npm ERR! Please include the following file with any support request:
npm ERR! C:\www\instantynode\src\npm-debug.log
package.json:
{
"name": "app",
"version": "0.1.1",
"description": "",
"dependencies": {
"bunyan": "1.5.1",
"co": "4.6.0",
"cookie-parser": "^1.4.0",
"forever": "^0.15.1",
"fs": "0.0.2",
"geoip-lite": "^1.1.6",
"handlebars": "^4.0.5",
"jsonwebtoken": "^5.4.1",
"jwt-simple": "^0.4.0",
"koa": "^1.1.2",
"koa-better-ratelimit": "^2.1.2",
"koa-bodyparser": "^2.0.1",
"koa-conditional-get": "^1.0.3",
"koa-generic-session": "^1.10.0",
"koa-handlebars": "^0.5.7",
"koa-mount": "^1.3.0",
"koa-multer": "1.0.0",
"koa-passport": "^2.0.1",
"koa-redis": "^1.0.1",
"koa-router": "^5.3.0",
"koa-static": "^1.5.2",
"lodash": "^3.10.1",
"mongodb": "2.1.4",
"nodemailer": "2.1.0",
"nodemon": "^1.8.1",
"passport": "^0.3.2",
"passport-http-bearer": "^1.0.1",
"passport-local": "^1.0.0",
"socket.io": "^1.3.7",
"socketio-jwt": "^4.3.3"
},
"devDependencies": {
"assert": "1.3.0",
"del": "2.1.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "3.1.0",
"gulp-concat": "2.6.0",
"gulp-concat-css": "2.2.0",
"gulp-imagemin": "2.4.0",
"gulp-less": "3.0.5",
"gulp-minify-css": "1.2.2",
"gulp-notify": "2.2.0",
"gulp-uglify": "1.5.1",
"imagemin-pngquant": "4.2.0",
"jsdoc": "3.4.0",
"node-inspector": "0.12.5",
"run-sequence": "1.1.5"
},
"main": "app.js",
"scripts": {
"startfn": "forever start -c \"nodemon --harmony\" app.js --exitcrash",
"startf": "forever start -c \"node --harmony\" app.js",
"start": "node --harmony app.js"
},
"author": "",
"license": "ISC"
}
npm install minimist --save does not work as you can see, does not install or add itself to the package.json file. And it is still mentioning mongoskin?
I have a feeling that the NPM in Windows is buggy?
i think that mongoskin only work with mongodb driver older than 1.4. You might have installed mongoskin in global mode, try to remove it.
You are trying to install minimist, which has its own package.json with its own dependencies. In these it says that it wants mongoskin to be installed, which has a dependency on mongodb itself, but in another version than you have it (you have 2.1.4 but as the error says, it needs ~1.4).
So, because you provided the --save parameter, you want npm to respect these dependencies and do not install mongodb in the desired version on top of it.
Ok I've found the issue. The NPM in Windows is way more sensitive than the one in Linux. In Linux I can manually remove the line from the package.json file and just remove the node_modules directory. However in Windows it appears to be cached by NPM, so I had to manually use the npm remove mongoskin --save command.
When I did this so that the package.json looked like it should I was able to install minimist via npm install minimist --save without issues!
I'm not surprised Windows... Not surprised...
In your package.json, try to change this:
"mongodb": "2.1.4",
to this:
"mongodb": "1.4.*",

Resources