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 read property replace of null #35

Closed
chrisjpalmer opened this issue Jul 7, 2018 · 5 comments
Closed

Cannot read property replace of null #35

chrisjpalmer opened this issue Jul 7, 2018 · 5 comments

Comments

@chrisjpalmer
Copy link

Hi guys. Trying to run npx on some packages but coming up with this error:

npx oclif single book-shelf-app



npx: installed 1 in 1.146s
Path must be a string. Received undefined
npx: installed 427 in 19.507s
C:\Users\chris\AppData\Roaming\npm-cache\_npx\25876\node_modules\oclif\bin\run
'yarn' is not recognized as an internal or external command,
operable program or batch file.
TypeError: Cannot read property 'replace' of null
    at C:/Users/chris/AppData/Roaming/npm-cache/_npx/25876/node_modules/oclif/node_modules/hosted-git-info/index.js:61:63
    at Array.map (<anonymous>)
    at fromUrl (C:/Users/chris/AppData/Roaming/npm-cache/_npx/25876/node_modules/oclif/node_modules/hosted-git-info/index.js:45:39)
    at Function.module.exports.fromUrl (C:/Users/chris/AppData/Roaming/npm-cache/_npx/25876/node_modules/oclif/node_modules/hosted-git-info/index.js:32:18)
    at Object.<anonymous> (C:/Users/chris/AppData/Roaming/npm-cache/_npx/25876/node_modules/oclif/node_modules/normalize-package-data/lib/fixer.js:150:36)
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (C:/Users/chris/AppData/Roaming/npm-cache/_npx/25876/node_modules/oclif/node_modules/normalize-package-data/lib/fixer.js:144:31)
    at Array.forEach (<anonymous>)
    at Object.fixDependencies (C:/Users/chris/AppData/Roaming/npm-cache/_npx/25876/node_modules/oclif/node_modules/normalize-package-data/lib/fixer.js:137:41)
    at C:/Users/chris/AppData/Roaming/npm-cache/_npx/25876/node_modules/oclif/node_modules/normalize-package-data/lib/normalize.js:32:38

Not sure if the error comes down to this package or not?

Chris

@Erveon
Copy link
Contributor

Erveon commented Jul 7, 2018

Same issue occurs when creating a fresh project with @vue/cli using release candidate 3
Looks like a new version was released an hour ago, that could be it.

This seems to be the change that causes the issue:
3349575#diff-168726dbe96b3ce427e7fedce31bb0bcL61

@daviwil
Copy link

daviwil commented Jul 7, 2018

I am also seeing this error:

2018-07-07T00:32:47.9733690Z TypeError: Cannot read property 'replace' of null
2018-07-07T00:32:47.9761100Z     at /Users/vsts/agent/2.134.2/work/1/s/apm/node_modules/atom-package-manager/node_modules/hosted-git-info/index.js:61:62
2018-07-07T00:32:47.9786110Z     at Array.map (native)
2018-07-07T00:32:47.9812020Z     at fromUrl (/Users/vsts/agent/2.134.2/work/1/s/apm/node_modules/atom-package-manager/node_modules/hosted-git-info/index.js:45:39)
2018-07-07T00:32:47.9839880Z     at Function.module.exports.fromUrl (/Users/vsts/agent/2.134.2/work/1/s/apm/node_modules/atom-package-manager/node_modules/hosted-git-info/index.js:32:18)
2018-07-07T00:32:47.9867370Z     at Install.module.exports.Install.getHostedGitInfo (/Users/vsts/agent/2.134.2/work/1/s/apm/node_modules/atom-package-manager/lib/install.js:703:28)
2018-07-07T00:32:47.9892320Z     at /Users/vsts/agent/2.134.2/work/1/s/apm/node_modules/atom-package-manager/lib/install.js:868:34
2018-07-07T00:32:47.9916990Z     at /Users/vsts/agent/2.134.2/work/1/s/apm/node_modules/atom-package-manager/lib/install.js:922:18
2018-07-07T00:32:47.9942250Z     at iteratee (/Users/vsts/agent/2.134.2/work/1/s/apm/node_modules/atom-package-manager/lib/install.js:926:16)
2018-07-07T00:32:47.9968170Z     at /Users/vsts/agent/2.134.2/work/1/s/apm/node_modules/atom-package-manager/node_modules/async/lib/async.js:227:13
2018-07-07T00:32:47.9993830Z     at iterate (/Users/vsts/agent/2.134.2/work/1/s/apm/node_modules/atom-package-manager/node_modules/async/lib/async.js:134:13)
2018-07-07T00:32:48.0015110Z child_process.js:624
2018-07-07T00:32:48.0033030Z     throw err;

@Erveon
Copy link
Contributor

Erveon commented Jul 7, 2018

I've made a quick PR #36
Feel free to correct it if it can be done better.

@daviwil
Copy link

daviwil commented Jul 7, 2018

Thanks @iarna and @Erveon for the quick fix!

@tiandavis
Copy link

Our ember-cli web application was bit by this as well. Thankfully in non-production environments. Thought the problem was with CircleCI initially too. Just wanted to say thanks to everyone who raised the issue and contributed to the PR fix here.

The Error:

Cannot read property 'replace' of null
TypeError: Cannot read property 'replace' of null
    at /root/project/node_modules/hosted-git-info/index.js:61:63
    at Array.map (<anonymous>)
    at fromUrl (/root/project/node_modules/hosted-git-info/index.js:45:39)
    at Function.module.exports.fromUrl (/root/project/node_modules/hosted-git-info/index.js:32:18)
    at npa (/root/project/node_modules/npm-package-arg/npa.js:78:38)
    at module.exports (/root/project/node_modules/ember-cli/lib/utilities/get-package-base-name.js:13:12)
    at Project.name (/root/project/node_modules/ember-cli/lib/models/project.js:155:12)
    at Project.initializeAddons (/root/project/node_modules/ember-cli/lib/models/project.js:385:50)
    at Project.eachAddonCommand (/root/project/node_modules/ember-cli/lib/models/project.js:451:12)
    at module.exports (/root/project/node_modules/ember-cli/lib/cli/lookup-command.js:33:13)

zkat added a commit to npm/cli that referenced this issue Aug 7, 2018
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

4 participants