This repository has been archived by the owner. It is now read-only.

npm ERR! Invalid name: "Hello World" #6860

Closed
kuyoonjo opened this Issue Dec 6, 2014 · 5 comments

Comments

Projects
None yet
5 participants
@kuyoonjo

kuyoonjo commented Dec 6, 2014

$ npm install exec-sync
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "exec-sync"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.11

npm ERR! Invalid name: "Hello World"
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/yuchen/IdeaProjects/Comparator/npm-debug.log

----------------------------------------------------------------------------------------------
$ cat npm-debug.log 
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
2 info using npm@2.1.11
3 info using node@v0.10.33
4 error install Couldn't read dependencies
5 verbose stack Error: Invalid name: "Hello World"
5 verbose stack     at ensureValidName (/usr/local/lib/node_modules/npm/node_modules/normalize-package-data/lib/fixer.js:322:15)
5 verbose stack     at Object.module.exports.fixNameField (/usr/local/lib/node_modules/npm/node_modules/normalize-package-data/lib/fixer.js:211:5)
5 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/normalize-package-data/lib/normalize.js:30:38
5 verbose stack     at Array.forEach (native)
5 verbose stack     at normalize (/usr/local/lib/node_modules/npm/node_modules/normalize-package-data/lib/normalize.js:29:15)
5 verbose stack     at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:342:33)
5 verbose stack     at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:126:33)
5 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:316:48
5 verbose stack     at evalmachine.<anonymous>:207:20
5 verbose stack     at OpenReq.Req.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:141:5)
6 verbose cwd /Users/yuchen/IdeaProjects/Comparator
7 error Darwin 14.0.0
8 error argv "node" "/usr/local/bin/npm" "install"
9 error node v0.10.33
10 error npm  v2.1.11
11 error Invalid name: "Hello World"
12 error If you need help, you may report this error at:
12 error     <http://github.com/npm/npm/issues>
13 verbose exit [ 1, true ]
@KenanY

This comment has been minimized.

Member

KenanY commented Dec 6, 2014

I take it that you have "Hello World" as the "name" field in your package.json? Capital letters and spaces are not allows in the "name" field of package.json.

@kuyoonjo

This comment has been minimized.

kuyoonjo commented Dec 6, 2014

Thank you very much, but i got a new problem.

$ npm install exec-sync
npm WARN package.json Comparator@0.0.1 No description
npm WARN package.json Comparator@0.0.1 No repository field.
npm WARN package.json Comparator@0.0.1 No README data
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "exec-sync"
npm ERR! node v0.10.33
npm ERR! npm  v2.1.11
npm ERR! path /Users/yuchen/.npm/debug/2.1.0
npm ERR! code EACCES
npm ERR! errno 3

npm ERR! Error: EACCES, mkdir '/Users/yuchen/.npm/debug/2.1.0'
npm ERR!  { [Error: EACCES, mkdir '/Users/yuchen/.npm/debug/2.1.0']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/yuchen/.npm/debug/2.1.0',
npm ERR!   parent: 'ffi' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/yuchen/IdeaProjects/Comparator/npm-debug.log

my JSON file:

{
  "name": "Comparator",
  "version": "0.0.1",
  "main": "index.html",
  "window": {
    "title": "Comparator",
    "toolbar": false,
    "frame": true,
    "width": 840,
    "height": 620,
    "resizable": false,
    "position": "mouse"
  }
}
@faiq

This comment has been minimized.

Contributor

faiq commented Dec 7, 2014

hey we're sorry to hear you're having another problem, but can you please post that one in a new github ticket? this way it'll be easier for us (the issue triagers) to keep all the issues sorted, and in turn help you better 😄

@othiym23 othiym23 added the support label Dec 15, 2014

@smikes

This comment has been minimized.

Contributor

smikes commented Feb 5, 2015

Is this still a problem for you?

This looks like you lack the necessary permissions to write to your npm cache. You can fix this like this:

chown -R yuchen ~/.npm

We are trying to clean up older npm issues, so if we don't hear back from you within a week, we will close this issue. (Don't worry -- you can always come back again and open a new issue!)

Thanks!

@othiym23

This comment has been minimized.

Contributor

othiym23 commented Feb 21, 2015

Closing as resolved.

@othiym23 othiym23 closed this Feb 21, 2015

mklarmann added a commit to mcmunder/eaternity-react that referenced this issue Dec 11, 2016

carocad added a commit to cobi-bike/DevKit-Simulator that referenced this issue Jun 14, 2017

AryanJ-NYC added a commit to chingu-voyage5/Bears-Team-3 that referenced this issue Jun 9, 2018

Fix name in package.json
Capital letters and spaces are not allowed in the name field of package.json.
More information here: npm/npm#6860 (comment)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.