2

I am trying to install some dependencies using npm install, but I am facing issues with it. I new to npm, so I am not able to figure out what is the problem in it?

Below is my command and its result.

npm install –- save babelify@7.2.0 browserify-middleware@7.0.0 express@4.13.3 react@0.14.3 reactify@1.1.1 browser-sync@2.10.0 babel-preset-react@6.3.13 babel-preset-es2015@6.3.13 browserify@12.0.1 react-dom@0.14.3 watchify@3.6.1

npm WARN package.json ReactJS_BluePrints_Scaffold@1.0.0 No repository field.
npm http GET https://registry.npmjs.org/babelify/7.2.0
npm http GET https://registry.npmjs.org/browserify-middleware/7.0.0
npm http GET https://registry.npmjs.org/express/4.13.3
npm http GET https://registry.npmjs.org/react/0.14.3
npm http GET https://registry.npmjs.org/reactify/1.1.1
npm http GET https://registry.npmjs.org/browser-sync/2.10.0
npm http GET https://registry.npmjs.org/babel-preset-react/6.3.13
npm http GET https://registry.npmjs.org/babel-preset-es2015/6.3.13
npm http GET https://registry.npmjs.org/browserify/12.0.1
npm http GET https://registry.npmjs.org/react-dom/0.14.3
npm http GET https://registry.npmjs.org/watchify/3.6.1
npm http GET https://registry.npmjs.org/%E2%80%93-save
npm http 304 https://registry.npmjs.org/react/0.14.3
npm http 304 https://registry.npmjs.org/express/4.13.3
npm http 304 https://registry.npmjs.org/browserify-middleware/7.0.0
npm http 304 https://registry.npmjs.org/babelify/7.2.0
npm http 304 https://registry.npmjs.org/reactify/1.1.1
npm http 304 https://registry.npmjs.org/browser-sync/2.10.0
npm http 304 https://registry.npmjs.org/babel-preset-react/6.3.13
npm http 304 https://registry.npmjs.org/babel-preset-es2015/6.3.13
npm http 304 https://registry.npmjs.org/browserify/12.0.1
npm http 304 https://registry.npmjs.org/react-dom/0.14.3
npm http 304 https://registry.npmjs.org/watchify/3.6.1
npm http 404 https://registry.npmjs.org/%E2%80%93-save
npm ERR! TypeError: Cannot read property 'latest' of undefined
npm ERR!     at next (/usr/share/npm/lib/cache.js:687:35)
npm ERR!     at /usr/share/npm/lib/cache.js:675:5
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 4.2.0-27-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "–-save" "babelify@7.2.0" "browserify-middleware@7.0.0" "express@4.13.3" "react@0.14.3" "reactify@1.1.1" "browser-sync@2.10.0" "babel-preset-react@6.3.13" "babel-preset-es2015@6.3.13" "browserify@12.0.1" "react-dom@0.14.3" "watchify@3.6.1"
npm ERR! cwd /home/user/reactapp
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! type non_object_property_load
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/user/reactapp/npm-debug.log
npm ERR! not ok code 0
learner
  • 6,062
  • 14
  • 79
  • 139

3 Answers3

1

You already got an approved answer but I wanted to add that I ran into a similar issue, receiving the frustrating message (I'm running on Windows):

TypeError: Cannot read property 'latest' of undefined

  • I tried fixing it by deleting the cache:

npm cache clean

  • Tried recloning repositories

My issue ended up being that I had two installations of nodejs. I don't know why this caused the error but after I uninstalled both versions and installed a new version, plus then deleted the npm in my appdata, only then did npm work properly again.

0

The save flag should be --save, not –- save. As the flag is malformed, npm will search for a package named –- (or for –-save since your last edit) .

Try this:

npm install --save babelify@7.2.0 browserify-middleware@7.0.0 express@4.13.3 react@0.14.3 reactify@1.1.1 browser-sync@2.10.0 babel-preset-react@6.3.13 babel-preset-es2015@6.3.13 browserify@12.0.1 react-dom@0.14.3 watchify@3.6.1
SLePort
  • 15,211
  • 3
  • 34
  • 44
  • I tried with --save also, same issue. I updated my post with --save now. Please let me know if there anything I am missing here in this command. I tried with just `npm install –-save watchify@3.6.1`, again same issue – learner Oct 29 '16 at 17:45
  • 1
    Before `save` in `npm install –-save watchify@3.6.1`, your first character is a en dash, slightly wider than the hyphen that should be used. Try `npm install --save watchify@3.6.1` – SLePort Oct 29 '16 at 17:54
  • WOW, good catch. Thanks a lot. But why the error message is completely different, does the error says anything about my command is wrong? Asking this just with curiosity. – learner Oct 29 '16 at 19:28
  • 1
    The helpful line is where npm is returning a `404` (not found) code for the `%E2%80%93-save` package (`%E2%80%93` is url encoded `–`). If you have no more error using correct flag, you can ignore the subsequent npm javascript code that won't help in your case. – SLePort Oct 30 '16 at 04:46
-1

Well, I had this same problem and I solved it by installing the latest version of NodeJS. Probably the error is internal in Node.