Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

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

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

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

kuyoonjo opened this issue Dec 6, 2014 · 5 comments
Labels

Comments

@kuyoonjo
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
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 😄

@smikes
Copy link
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
Copy link
Contributor

Closing as resolved.

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
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.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants