Okrus Nakamoto
Okrus Nakamoto

Reputation: 23

Trying to run nodejs script with npm run build

I was trying to run this script: https://github.com/drenther/bdnd_example, but then I got this error: npm ERR! Invalid name: "Line up the heroes"

I've tried reinstalling everything multiple times.

Error log:

1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Devx8\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: Invalid name: "Line up the heroes"
4 verbose stack     at ensureValidName (C:\Users\Devx8\AppData\Roaming\npm\node_modules\npm\node_modules\normalize-package-data\lib\fixer.js:336:15)
4 verbose stack     at Object.fixNameField (C:\Users\Devx8\AppData\Roaming\npm\node_modules\npm\node_modules\normalize-package-data\lib\fixer.js:215:5)
4 verbose stack     at C:\Users\Devx8\AppData\Roaming\npm\node_modules\npm\node_modules\normalize-package-data\lib\normalize.js:32:38
4 verbose stack     at Array.forEach (<anonymous>)
4 verbose stack     at normalize (C:\Users\Devx8\AppData\Roaming\npm\node_modules\npm\node_modules\normalize-package-data\lib\normalize.js:31:15)
4 verbose stack     at final (C:\Users\Devx8\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:411:5)
4 verbose stack     at then (C:\Users\Devx8\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:160:5)
4 verbose stack     at C:\Users\Devx8\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-json\read-json.js:280:12
4 verbose stack     at C:\Users\Devx8\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:90:16
4 verbose stack     at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
5 verbose cwd C:\xampp2\htdocs\todonew
6 verbose Windows_NT 10.0.17134
7 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Devx8\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
8 verbose node v10.16.0
9 verbose npm  v6.9.0
10 error Invalid name: "Line up the heroes"
11 verbose exit [ 1, true ]

Upvotes: 0

Views: 457

Answers (1)

Ahmed Kamal
Ahmed Kamal

Reputation: 3010

the npm package name must not contain space or capital letters change the name in your package.json file to something like lineuptheheroes (just for test) and try again, also check the documentation here for how to write a valid name.

Upvotes: 1

Related Questions