Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add dependencies starting with @ any more #6

Closed
cdipiet opened this issue Aug 21, 2019 · 3 comments
Closed

Cannot add dependencies starting with @ any more #6

cdipiet opened this issue Aug 21, 2019 · 3 comments

Comments

@cdipiet
Copy link

cdipiet commented Aug 21, 2019

Expected Behavior

npm-add-dependencies @angular/material
ok

Actual Behavior

npm-add-dependencies @angular/material
This script adds dependencies (latest or specified versions) into the package.json file without installing them

Adding packages to 'dependencies'...
undefined:2
versions@0.3.0 | MIT | deps: 8 | versions: 17
^

SyntaxError: Unexpected token n JSON at position 1
at JSON.parse ()
at npmRun.exec (C:\Users\c383650\AppData\Roaming\npm\node_modules\npm-add-dependencies\index.js:69:42)
at ChildProcess.exithandler (child_process.js:285:7)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)

Steps to Reproduce the Problem

  1. Try to add any dependency whose name starts with @, example: npm-add-dependencies @angular/material

Specifications

  • Version: 0.2.0
  • Platform: Windows, Linux
  • Subsystem:

Hello, on rorw 59 of index.js i found:
runNpmShow(dep) {
const [depName, depVersion] = dep.split('@');

such split cause an undefined depName when package name starts with @

@arfeo
Copy link
Owner

arfeo commented Aug 21, 2019

Hi, I am sorry for that. Please, use version 0.1.5 now. I will push fixes in a day. Thanks.

arfeo added a commit that referenced this issue Aug 21, 2019
@arfeo
Copy link
Owner

arfeo commented Aug 21, 2019

Fixed in version 0.2.1

@cdipiet
Copy link
Author

cdipiet commented Aug 21, 2019

Thank you so much, it's working perfectly now!

@cdipiet cdipiet closed this as completed Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants