This is a followup question to my earlier question (but is an independent question)
I am trying to install react and react-dom on a Mac:
npm install --save react react-dom
but get the following warnings (path names replaced with ...
):
npm WARN saveError ENOENT: no such file or directory, open '/Users/../Z/package.json'
/Users/.../Z
├─┬ react@15.4.1
│ ├─┬ fbjs@0.8.8
│ │ ├── core-js@1.2.7
│ │ ├─┬ isomorphic-fetch@2.2.1
│ │ │ ├─┬ node-fetch@1.6.3
│ │ │ │ ├─┬ encoding@0.1.12
│ │ │ │ │ └── iconv-lite@0.4.15
│ │ │ │ └── is-stream@1.1.0
│ │ │ └── whatwg-fetch@2.0.1
│ │ ├─┬ promise@7.1.1
│ │ │ └── asap@2.0.5
│ │ ├── setimmediate@1.0.5
│ │ └── ua-parser-js@0.7.12
│ ├─┬ loose-envify@1.3.0
│ │ └── js-tokens@2.0.0
│ └── object-assign@4.1.0
└── react-dom@15.4.1
npm WARN enoent ENOENT: no such file or directory, open '/Users/.../Z/package.json'
npm WARN Z No description
npm WARN Z No repository field.
npm WARN Z No README data
npm WARN Z No license field.
I searched around a bit but did not find a good reason for these warnings. SO posts like these seem to suggest installing react in the same directory where node modules are installed. My node is installed in usr/local/bin
but package.json
does not appear anywhere on the machine even on a global search. I just installed npm before trying to install react so don't think its a versioning issue.