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

Running vue-cli-service fails with an exception "Cannot read property 'replace' of null" #1781

Closed
jaromero opened this issue Jul 7, 2018 · 5 comments
Labels

Comments

@jaromero
Copy link

jaromero commented Jul 7, 2018

Version

3.0.0-rc.3

Reproduction link

https://github.com/jaromero/vue-cli-service-error-demo

Steps to reproduce

  1. vue create my-app
  2. Select any options you want and let the project be created
  3. cd my-app && yarn run serve (or npm if chosen)
  4. Try running any vue-cli-service command, like npx vue-cli-service serve

What is expected?

No errors; vue-cli-service should run as expected.

What is actually happening?

When vue-cli-service is run with npx, the output is simply:

Cannot read property 'replace' of null

With yarn, the output is:

yarn run v1.7.0
$ vue-cli-service serve                                                                                                                                                                                                                        
/home/nsdragon/test/vue-cli/my-app/node_modules/hosted-git-info/index.js:73
      if (!(ex instanceof URIError)) throw ex
                                     ^

TypeError: Cannot read property 'replace' of null                                                                                                                                                                                              
    at /home/nsdragon/test/vue-cli/my-app/node_modules/hosted-git-info/index.js:61:63
    at Array.map (<anonymous>)
    at fromUrl (/home/nsdragon/test/vue-cli/my-app/node_modules/hosted-git-info/index.js:45:39)
    at Function.module.exports.fromUrl (/home/nsdragon/test/vue-cli/my-app/node_modules/hosted-git-info/index.js:32:18)
    at Object.<anonymous> (/home/nsdragon/test/vue-cli/my-app/node_modules/normalize-package-data/lib/fixer.js:150:36)
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/home/nsdragon/test/vue-cli/my-app/node_modules/normalize-package-data/lib/fixer.js:144:31)
    at Array.forEach (<anonymous>)
    at Object.fixDependencies (/home/nsdragon/test/vue-cli/my-app/node_modules/normalize-package-data/lib/fixer.js:137:41)                                                                                                                     
    at /home/nsdragon/test/vue-cli/my-app/node_modules/normalize-package-data/lib/normalize.js:32:38
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

(npm shows largely the same information, plus npm-specific info like this is not a problem with npm, debug log at /path/to/wherever/debug.log etc.)

Even with pnpm (and installing dependencies with the --shamefully-flatten flag) this fails and produces the same error as npm.


Node: 10.6.0
npm: 6.1.0
yarn: 1.7.0

@Aiden01
Copy link

Aiden01 commented Jul 7, 2018

I've got the same error.

@chasebank
Copy link

Same, getting this on two different Windows computers

@chasebank
Copy link

Looks like this was an issue with hosted-git-info, and they just merged a quick fix an hour ago.

npm/hosted-git-info#35

Updating hosted-git-info resolved the issue for me

@Aiden01
Copy link

Aiden01 commented Jul 7, 2018

@chasebank Thanks, worked for me too.

@Akryum Akryum added the upstream label Jul 7, 2018
@LinusBorg
Copy link
Member

We'll leave this open for a while so people with the same problem find this info more easily, but this could be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants